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 ad‐
13 dition, 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 ex‐
68 tra 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 TABLET CONFIGURATION
101 input <identifier> tool_mode <tool> <absolute|relative>
102 Sets whether movement of a tablet tool should be treated as abso‐
103 lute or relative; the default is absolute.
104
105 Valid values for <tool> are currently "pen", "eraser", "brush",
106 "pencil", "airbrush", and the wildcard *, which matches all tools.
107
108 Mouse and lens tools ignore this setting and are always treated as
109 relative.
110
111 MAPPING CONFIGURATION
112 input <identifier> map_to_output <identifier>
113 Maps inputs from this device to the specified output. Only meaning‐
114 ful if the device is a pointer, touch, or drawing tablet device.
115
116 The wildcard * can be used to map the input device to the whole
117 desktop layout.
118
119 input <identifier> map_to_region <X> <Y> <width> <height>
120 Maps inputs from this device to the specified region of the global
121 output layout. Only meaningful if the device is a pointer, touch,
122 or drawing tablet device.
123
124 input <identifier> map_from_region <X1xY1> <X2xY2>
125 Ignores inputs from this device that do not occur within the speci‐
126 fied region. Can be in millimeters (e.g. 10x20mm 20x40mm) or in
127 terms of 0..1 (e.g. 0.5x0.5 0.7x0.7). Not all devices support mil‐
128 limeters. Only meaningful if the device is not a keyboard and pro‐
129 vides events in absolute terms (such as a drawing tablet or touch
130 screen - most pointers provide events relative to the previous
131 frame).
132
133 LIBINPUT CONFIGURATION
134 input <identifier> accel_profile adaptive|flat
135 Sets the pointer acceleration profile for the specified input de‐
136 vice.
137
138 input <identifier> calibration_matrix <6 space-separated floating point
139 values>
140 Sets the calibration matrix.
141
142 input <identifier> click_method none|button_areas|clickfinger
143 Changes the click method for the specified device.
144
145 input <identifier> drag enabled|disabled
146 Enables or disables tap-and-drag for specified input device.
147
148 input <identifier> drag_lock enabled|disabled
149 Enables or disables drag lock for specified input device.
150
151 input <identifier> dwt enabled|disabled
152 Enables or disables disable-while-typing for the specified input
153 device.
154
155 input <identifier> events enabled|disabled|disabled_on_exter‐
156 nal_mouse|toggle [<toggle-modes>]
157 Enables or disables send_events for specified input device. Dis‐
158 abling send_events disables the input device.
159
160 The toggle option cannot be used in the config. If no toggle modes
161 are listed, all supported modes for the device will be toggled
162 through in the order: enabled, disabled_on_external_mouse, dis‐
163 abled, (loop back). If toggle modes are listed, they will be cycled
164 through, defaulting to the first mode listed if the current mode is
165 not in the list. They will also not be checked to see if they are
166 supported for the device and may fail.
167
168 input <identifier> left_handed enabled|disabled
169 Enables or disables left handed mode for specified input device.
170
171 input <identifier> middle_emulation enabled|disabled
172 Enables or disables middle click emulation.
173
174 input <identifier> natural_scroll enabled|disabled
175 Enables or disables natural (inverted) scrolling for the specified
176 input device.
177
178 input <identifier> pointer_accel [<-1|1>]
179 Changes the pointer acceleration for the specified input device.
180
181 input <identifier> scroll_button disable|button[1-3,8,9]|<event-code-
182 or-name>
183 Sets the button used for scroll_method on_button_down. The button
184 can be given as an event name or code, which can be obtained from
185 libinput debug-events, or as a x11 mouse button (button[1-3,8,9]).
186 If set to disable, it disables the scroll_method on_button_down.
187
188 input <identifier> scroll_factor <floating point value>
189 Changes the scroll factor for the specified input device. Scroll
190 speed will be scaled by the given value, which must be non-nega‐
191 tive.
192
193 input <identifier> scroll_method none|two_finger|edge|on_button_down
194 Changes the scroll method for the specified input device.
195
196 input <identifier> tap enabled|disabled
197 Enables or disables tap for specified input device.
198
199 input <identifier> tap_button_map lrm|lmr
200 Specifies which button mapping to use for tapping. lrm treats 1
201 finger as left click, 2 fingers as right click, and 3 fingers as
202 middle click. lmr treats 1 finger as left click, 2 fingers as mid‐
203 dle click, and 3 fingers as right click.
204
205 SEAT CONFIGURATION
206 Configure options for multiseat mode.
207
208 A seat is a collection of input devices that act independently of each
209 other. Seats are identified by name and the default seat is seat0 if no
210 seats are configured. While sway is running, - (hyphen) can be used as
211 an alias for the current seat. Each seat has an independent keyboard
212 focus and a separate cursor that is controlled by the pointer devices
213 of the seat. This is useful for multiple people using the desktop at
214 the same time with their own devices (each sitting in their own
215 "seat"). The wildcard character, *, can also be used in place of <iden‐
216 tifier> to change settings for all seats.
217
218 Tip: If the configuration settings do not appear to be taking effect,
219 you could try using * instead of <identifier>. If it works with the
220 wildcard, try using a different identifier from swaymsg -t get_seats
221 until you find the correct seat.
222
223 seat <name> attach <input_identifier>
224 Attach an input device to this seat by its input identifier. A spe‐
225 cial value of "*" will attach all devices to the seat.
226
227 seat <seat> cursor move|set <x> <y>
228 Move specified seat's cursor relative to current position or wrap
229 to absolute coordinates (with respect to the global coordinate
230 space). Specifying either value as 0 will not update that coordi‐
231 nate.
232
233 seat <seat> cursor press|release button[1-9]|<event-name-or-code>
234 Simulate pressing (or releasing) the specified mouse button on the
235 specified seat. The button can either be provided as a button event
236 name or event code, which can be obtained from libinput debug-
237 events, or as an x11 mouse button (button[1-9]). If using but‐
238 ton[4-7], which map to axes, an axis event will be simulated, how‐
239 ever press and release will be ignored and both will occur.
240
241 seat <name> fallback true|false
242 Set this seat as the fallback seat. A fallback seat will attach any
243 device not explicitly attached to another seat (similar to a "de‐
244 fault" seat).
245
246 seat <name> hide_cursor <timeout>|when-typing [enable|disable]
247 Hides the cursor image after the specified event occurred.
248
249 If timeout is specified, then the cursor will be hidden after time‐
250 out (in milliseconds) has elapsed with no activity on the cursor. A
251 timeout of 0 (default) disables hiding the cursor. The minimal
252 timeout is 100 and any value less than that (aside from 0), will be
253 increased to 100.
254
255 If when-typing is enabled, then the cursor will be hidden whenever
256 a key is pressed.
257
258 seat <name> idle_inhibit <sources...>
259 Sets the set of input event sources which can prevent the seat from
260 becoming idle, as a space separated list of source names. Valid
261 names are "keyboard", "pointer", "touchpad", "touch", "tablet_pad",
262 "tablet_tool", and "switch". The default behavior is to prevent
263 idle on any event.
264
265 seat <name> idle_wake <sources...>
266 Sets the set of input event sources which can wake the seat from
267 its idle state, as a space separated list of source names. Valid
268 names are "keyboard", "pointer", "touchpad", "touch", "tablet_pad",
269 "tablet_tool", and "switch". The default behavior is to wake from
270 idle on any event.
271
272 seat <name> keyboard_grouping none|smart
273 Set how the keyboards in the seat are grouped together. Currently,
274 there are two options. none will disable all keyboard grouping.
275 This will make it so each keyboard device has its own isolated
276 state. smart will group the keyboards in the seat by their keymap
277 and repeat info. This is useful for when the keyboard appears as
278 multiple separate input devices. In this mode, the effective layout
279 is synced between the keyboards in the group. The default is smart.
280 To restore the behavior of older versions of sway, use none.
281
282 seat <name> pointer_constraint enable|disable|escape
283 Enables or disables the ability for clients to capture the cursor
284 (enabled by default) for the seat. This is primarily useful for
285 video games. The "escape" command can be used at runtime to escape
286 from a captured client.
287
288 seat <name> shortcuts_inhibitor enable|disable|activate|deactivate|tog‐
289 gle
290 Enables or disables the ability of clients to inhibit keyboard
291 shortcuts for the seat. This is primarily useful for virtualization
292 and remote desktop software. Subcommands enable and disable affect
293 whether future inhibitors are honoured by default, i.e. activated
294 automatically, the default being enable. When used at runtime, dis‐
295 able also disables any currently active inhibitors. activate, deac‐
296 tivate and toggle are only usable at runtime and change the state
297 of a potentially existing inhibitor on the currently focused win‐
298 dow. This can be used with the current seat alias (-) to affect
299 only the currently focused window of the current seat. Subcommand
300 deactivate is particularly useful in an --inhibited bindsym to es‐
301 cape a state where shortcuts are inhibited and the client becomes
302 uncooperative. It is worth noting that whether disabled or deacti‐
303 vated inhibitors are removed is entirely up to the client. Depend‐
304 ing on the client it may therefore be possible to (re-)activate
305 them later. Any visual indication that an inhibitor is present is
306 currently left to the client as well.
307
308 seat <name> xcursor_theme <theme> [<size>]
309 Override the system default XCursor theme. The default seat's
310 (seat0) theme is also used as the default cursor theme in XWayland,
311 and exported through the XCURSOR_THEME and XCURSOR_SIZE environment
312 variables.
313
315 sway(5) sway-output(5) xkeyboard-config(7)
316
317
318
319 2022-01-22 sway-input(5)