1sway-input(5) File Formats Manual sway-input(5)
2
3
4
6 sway-input - input configuration file and commands
7
9 Sway allows for configuration of devices within the sway configuration
10 file. To obtain a list of available device identifiers, run swaymsg -t
11 get_inputs. Settings can also be applied to all input devices by using
12 the wildcard, *, in place of <identifier> in the commands below. In
13 addition, the settings can be applied to a type of device, by using
14 type:<input_type> in place of <identifier>.
15
16 In the configuration file, settings with a more specific selector take
17 precedence over more general ones: <identifier> > type:<input_type> >
18 *. When executing input commands, however, the settings are applied to
19 all matching input devices! This means that type:<input_type> can
20 override previously set <identifier> settings, even though in a config‐
21 uration file they would take precedence. Similarly * can override both
22 <identifier> and type:<input_type> settings, if applied later.
23
24 Tip: If the configuration settings do not appear to be taking effect,
25 you could try using * instead of <identifier>. If it works with the
26 wildcard, try using a different identifier from swaymsg -t get_inputs
27 until you find the correct input device.
28
29 Current available input types are:
30
31 · touchpad
32 · pointer
33 · keyboard
34 · touch
35 · tablet_tool
36 · tablet_pad
37 · switch
38
39
40 Note: The type configurations are applied as the devices appear and get
41 applied on top of the existing device configurations.
42
44 KEYBOARD CONFIGURATION
45 input <identifier> repeat_delay <milliseconds>
46 Sets the amount of time a key must be held before it starts repeat‐
47 ing.
48
49 input <identifier> repeat_rate <characters per second>
50 Sets the frequency of key repeats once the repeat_delay has passed.
51
52 For more information on these xkb configuration options, see xkeyboard-
53 config(7).
54
55 input <identifier> xkb_file <file_name>
56 Sets all xkb configurations from a complete .xkb file. This file
57 can be dumped from xkbcomp $DISPLAY keymap.xkb. This setting over‐
58 rides xkb_layout, xkb_model, xkb_options, xkb_rules, and xkb_vari‐
59 ant settings.
60
61 input <identifier> xkb_layout <layout_name>
62 Sets the layout of the keyboard like us or de.
63
64 Multiple layouts can be specified by separating them with commas.
65
66 input <identifier> xkb_model <model_name>
67 Sets the model of the keyboard. This has an influence for some
68 extra keys your keyboard might have.
69
70 input <identifier> xkb_options <options>
71 Sets extra xkb configuration options for the keyboard.
72
73 Multiple options can be specified by separating them with commas.
74
75 input <identifier> xkb_rules <rules>
76 Sets files of rules to be used for keyboard mapping composition.
77
78 input <identifier> xkb_switch_layout <index>|next|prev
79 Changes the active keyboard layout to <index> counting from zero or
80 to next or previous layout on the list. If there is no next or pre‐
81 vious layout, this command hops to the other end of the list.
82
83 This can be used when multiple layouts are configured with xkb_lay‐
84 out. A list of layouts you can switch between can be obtained with
85 swaymsg -t get_inputs.
86
87 input <identifier> xkb_variant <variant>
88 Sets the variant of the keyboard like dvorak or colemak.
89
90 The following commands may only be used in the configuration file.
91
92 input <identifier> xkb_capslock enabled|disabled
93 Initially enables or disables CapsLock on startup, the default is
94 disabled.
95
96 input <identifier> xkb_numlock enabled|disabled
97 Initially enables or disables NumLock on startup, the default is
98 disabled.
99
100 MAPPING CONFIGURATION
101 input <identifier> map_to_output <identifier>
102 Maps inputs from this device to the specified output. Only meaning‐
103 ful if the device is a pointer, touch, or drawing tablet device.
104
105 input <identifier> map_to_region <X> <Y> <width> <height>
106 Maps inputs from this device to the specified region of the global
107 output layout. Only meaningful if the device is a pointer, touch,
108 or drawing tablet device.
109
110 input <identifier> map_from_region <X1xY1> <X2xY2>
111 Ignores inputs from this device that do not occur within the speci‐
112 fied region. Can be in millimeters (e.g. 10x20mm 20x40mm) or in
113 terms of 0..1 (e.g. 0.5x0.5 0.7x0.7). Not all devices support mil‐
114 limeters. Only meaningful if the device is not a keyboard and pro‐
115 vides events in absolute terms (such as a drawing tablet or touch
116 screen - most pointers provide events relative to the previous
117 frame).
118
119 LIBINPUT CONFIGURATION
120 input <identifier> accel_profile adaptive|flat
121 Sets the pointer acceleration profile for the specified input
122 device.
123
124 input <identifier> calibration_matrix <6 space-separated floating point
125 values>
126 Sets the calibration matrix.
127
128 input <identifier> click_method none|button_areas|clickfinger
129 Changes the click method for the specified device.
130
131 input <identifier> drag enabled|disabled
132 Enables or disables tap-and-drag for specified input device.
133
134 input <identifier> drag_lock enabled|disabled
135 Enables or disables drag lock for specified input device.
136
137 input <identifier> dwt enabled|disabled
138 Enables or disables disable-while-typing for the specified input
139 device.
140
141 input <identifier> events enabled|disabled|disabled_on_exter‐
142 nal_mouse|toggle [<toggle-modes>]
143 Enables or disables send_events for specified input device. Dis‐
144 abling send_events disables the input device.
145
146 The toggle option cannot be used in the config. If no toggle modes
147 are listed, all supported modes for the device will be toggled
148 through in the order: enabled, disabled_on_external_mouse, dis‐
149 abled, (loop back). If toggle modes are listed, they will be cycled
150 through, defaulting to the first mode listed if the current mode is
151 not in the list. They will also not be checked to see if they are
152 supported for the device and may fail.
153
154 input <identifier> left_handed enabled|disabled
155 Enables or disables left handed mode for specified input device.
156
157 input <identifier> middle_emulation enabled|disabled
158 Enables or disables middle click emulation.
159
160 input <identifier> natural_scroll enabled|disabled
161 Enables or disables natural (inverted) scrolling for the specified
162 input device.
163
164 input <identifier> pointer_accel [<-1|1>]
165 Changes the pointer acceleration for the specified input device.
166
167 input <identifier> scroll_button disable|button[1-3,8,9]|<event-code-
168 or-name>
169 Sets the button used for scroll_method on_button_down. The button
170 can be given as an event name or code, which can be obtained from
171 libinput debug-events, or as a x11 mouse button (button[1-3,8,9]).
172 If set to disable, it disables the scroll_method on_button_down.
173
174 input <identifier> scroll_factor <floating point value>
175 Changes the scroll factor for the specified input device. Scroll
176 speed will be scaled by the given value, which must be non-nega‐
177 tive.
178
179 input <identifier> scroll_method none|two_finger|edge|on_button_down
180 Changes the scroll method for the specified input device.
181
182 input <identifier> tap enabled|disabled
183 Enables or disables tap for specified input device.
184
185 input <identifier> tap_button_map lrm|lmr
186 Specifies which button mapping to use for tapping. lrm treats 1
187 finger as left click, 2 fingers as right click, and 3 fingers as
188 middle click. lmr treats 1 finger as left click, 2 fingers as mid‐
189 dle click, and 3 fingers as right click.
190
191 SEAT CONFIGURATION
192 Configure options for multiseat mode.
193
194 A seat is a collection of input devices that act independently of each
195 other. Seats are identified by name and the default seat is seat0 if
196 no seats are configured. While sway is running, - (hyphen) can be used
197 as an alias for the current seat. Each seat has an independent keyboard
198 focus and a separate cursor that is controlled by the pointer devices
199 of the seat. This is useful for multiple people using the desktop at
200 the same time with their own devices (each sitting in their own
201 "seat"). The wildcard character, *, can also be used in place of <iden‐
202 tifier> to change settings for all seats.
203
204 Tip: If the configuration settings do not appear to be taking effect,
205 you could try using * instead of <identifier>. If it works with the
206 wildcard, try using a different identifier from swaymsg -t get_seats
207 until you find the correct seat.
208
209 seat <name> attach <input_identifier>
210 Attach an input device to this seat by its input identifier. A spe‐
211 cial value of "*" will attach all devices to the seat.
212
213 seat <seat> cursor move|set <x> <y>
214 Move specified seat's cursor relative to current position or wrap
215 to absolute coordinates (with respect to the global coordinate
216 space). Specifying either value as 0 will not update that coordi‐
217 nate.
218
219 seat <seat> cursor press|release button[1-9]|<event-name-or-code>
220 Simulate pressing (or releasing) the specified mouse button on the
221 specified seat. The button can either be provided as a button event
222 name or event code, which can be obtained from libinput debug-
223 events, or as an x11 mouse button (button[1-9]). If using but‐
224 ton[4-7], which map to axes, an axis event will be simulated, how‐
225 ever press and release will be ignored and both will occur.
226
227 seat <name> fallback true|false
228 Set this seat as the fallback seat. A fallback seat will attach any
229 device not explicitly attached to another seat (similar to a
230 "default" seat).
231
232 seat <name> hide_cursor <timeout>
233 Hides the cursor image after the specified timeout (in millisec‐
234 onds) has elapsed with no activity on that cursor. A timeout of 0
235 (default) disables hiding the cursor. The minimal timeout is 100
236 and any value less than that (aside from 0), will be increased to
237 100.
238
239 seat <name> idle_inhibit <sources...>
240 Sets the set of input event sources which can prevent the seat from
241 becoming idle, as a space separated list of source names. Valid
242 names are "keyboard", "pointer", "touchpad", "touch", "tablet_pad",
243 "tablet_tool", and "switch". The default behavior is to prevent
244 idle on any event.
245
246 seat <name> idle_wake <sources...>
247 Sets the set of input event sources which can wake the seat from
248 its idle state, as a space separated list of source names. Valid
249 names are "keyboard", "pointer", "touchpad", "touch", "tablet_pad",
250 "tablet_tool", and "switch". The default behavior is to wake from
251 idle on any event.
252
253 seat <name> keyboard_grouping none|smart
254 Set how the keyboards in the seat are grouped together. Currently,
255 there are two options. none will disable all keyboard grouping.
256 This will make it so each keyboard device has its own isolated
257 state. smart will group the keyboards in the seat by their keymap
258 and repeat info. This is useful for when the keyboard appears as
259 multiple separate input devices. In this mode, the effective lay‐
260 out is synced between the keyboards in the group. The default is
261 smart. To restore the behavior of older versions of sway, use none.
262
263 seat <name> pointer_constraint enable|disable|escape
264 Enables or disables the ability for clients to capture the cursor
265 (enabled by default) for the seat. This is primarily useful for
266 video games. The "escape" command can be used at runtime to escape
267 from a captured client.
268
269 seat <name> shortcuts_inhibitor enable|disable|activate|deactivate|tog‐
270 gle
271 Enables or disables the ability of clients to inhibit keyboard
272 shortcuts for the seat. This is primarily useful for virtualization
273 and remote desktop software. Subcommands enable and disable affect
274 whether future inhibitors are honoured by default, i.e. activated
275 automatically, the default being enable. When used at runtime, dis‐
276 able also disables any currently active inhibitors. activate, deac‐
277 tivate and toggle are only useable at runtime and change the state
278 of a potentially existing inhibitor on the currently focused win‐
279 dow. This can be used with the current seat alias (-) to affect
280 only the currently focused window of the current seat. Subcommand
281 deactivate is particularly useful in an --inhibited bindsym to
282 escape a state where shortcuts are inhibited and the client becomes
283 uncooperative. It is worth noting that whether disabled or deacti‐
284 vated inhibitors are removed is entirely up to the client. Depend‐
285 ing on the client it may therefore be possible to (re-)activate
286 them later. Any visual indication that an inhibitor is present is
287 currently left to the client as well.
288
289 seat <name> xcursor_theme <theme> [<size>]
290 Override the system default XCursor theme. The default seat's
291 (seat0) theme is also used as the default cursor theme in XWayland,
292 and exported through the XCURSOR_THEME and XCURSOR_SIZE environment
293 variables.
294
296 sway(5) sway-output(5) xkeyboard-config(7)
297
298
299
300 2020-10-22 sway-input(5)