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> dwtp enabled|disabled
156 Enables or disables disable-while-trackpointing for the specified
157 input device.
158
159 input <identifier> events enabled|disabled|disabled_on_exter‐
160 nal_mouse|toggle [<toggle-modes>]
161 Enables or disables send_events for specified input device. Dis‐
162 abling send_events disables the input device.
163
164 The toggle option cannot be used in the config. If no toggle modes
165 are listed, all supported modes for the device will be toggled
166 through in the order: enabled, disabled_on_external_mouse, dis‐
167 abled, (loop back). If toggle modes are listed, they will be cycled
168 through, defaulting to the first mode listed if the current mode is
169 not in the list. They will also not be checked to see if they are
170 supported for the device and may fail.
171
172 input <identifier> left_handed enabled|disabled
173 Enables or disables left handed mode for specified input device.
174
175 input <identifier> middle_emulation enabled|disabled
176 Enables or disables middle click emulation.
177
178 input <identifier> natural_scroll enabled|disabled
179 Enables or disables natural (inverted) scrolling for the specified
180 input device.
181
182 input <identifier> pointer_accel [<-1|1>]
183 Changes the pointer acceleration for the specified input device.
184
185 input <identifier> scroll_button disable|button[1-3,8,9]|<event-code-
186 or-name>
187 Sets the button used for scroll_method on_button_down. The button
188 can be given as an event name or code, which can be obtained from
189 libinput debug-events, or as a x11 mouse button (button[1-3,8,9]).
190 If set to disable, it disables the scroll_method on_button_down.
191
192 input <identifier> scroll_factor <floating point value>
193 Changes the scroll factor for the specified input device. Scroll
194 speed will be scaled by the given value, which must be non-nega‐
195 tive.
196
197 input <identifier> scroll_method none|two_finger|edge|on_button_down
198 Changes the scroll method for the specified input device.
199
200 input <identifier> tap enabled|disabled
201 Enables or disables tap for specified input device.
202
203 input <identifier> tap_button_map lrm|lmr
204 Specifies which button mapping to use for tapping. lrm treats 1
205 finger as left click, 2 fingers as right click, and 3 fingers as
206 middle click. lmr treats 1 finger as left click, 2 fingers as mid‐
207 dle click, and 3 fingers as right click.
208
209 SEAT CONFIGURATION
210 Configure options for multiseat mode.
211
212 A seat is a collection of input devices that act independently of each
213 other. Seats are identified by name and the default seat is seat0 if no
214 seats are configured. While sway is running, - (hyphen) can be used as
215 an alias for the current seat. Each seat has an independent keyboard
216 focus and a separate cursor that is controlled by the pointer devices
217 of the seat. This is useful for multiple people using the desktop at
218 the same time with their own devices (each sitting in their own
219 "seat"). The wildcard character, *, can also be used in place of <iden‐
220 tifier> to change settings for all seats.
221
222 Tip: If the configuration settings do not appear to be taking effect,
223 you could try using * instead of <identifier>. If it works with the
224 wildcard, try using a different identifier from swaymsg -t get_seats
225 until you find the correct seat.
226
227 seat <name> attach <input_identifier>
228 Attach an input device to this seat by its input identifier. A spe‐
229 cial value of "*" will attach all devices to the seat.
230
231 seat <seat> cursor move|set <x> <y>
232 Move specified seat's cursor relative to current position or wrap
233 to absolute coordinates (with respect to the global coordinate
234 space). Specifying either value as 0 will not update that coordi‐
235 nate.
236
237 seat <seat> cursor press|release button[1-9]|<event-name-or-code>
238 Simulate pressing (or releasing) the specified mouse button on the
239 specified seat. The button can either be provided as a button event
240 name or event code, which can be obtained from libinput debug-
241 events, or as an x11 mouse button (button[1-9]). If using but‐
242 ton[4-7], which map to axes, an axis event will be simulated, how‐
243 ever press and release will be ignored and both will occur.
244
245 seat <name> fallback true|false
246 Set this seat as the fallback seat. A fallback seat will attach any
247 device not explicitly attached to another seat (similar to a "de‐
248 fault" seat).
249
250 seat <name> hide_cursor <timeout>|when-typing [enable|disable]
251 Hides the cursor image after the specified event occurred.
252
253 If timeout is specified, then the cursor will be hidden after time‐
254 out (in milliseconds) has elapsed with no activity on the cursor. A
255 timeout of 0 (default) disables hiding the cursor. The minimal
256 timeout is 100 and any value less than that (aside from 0), will be
257 increased to 100.
258
259 If when-typing is enabled, then the cursor will be hidden whenever
260 a key is pressed.
261
262 seat <name> idle_inhibit <sources...>
263 Sets the set of input event sources which can prevent the seat from
264 becoming idle, as a space separated list of source names. Valid
265 names are "keyboard", "pointer", "touchpad", "touch", "tablet_pad",
266 "tablet_tool", and "switch". The default behavior is to prevent
267 idle on any event.
268
269 seat <name> idle_wake <sources...>
270 Sets the set of input event sources which can wake the seat from
271 its idle state, as a space separated list of source names. Valid
272 names are "keyboard", "pointer", "touchpad", "touch", "tablet_pad",
273 "tablet_tool", and "switch". The default behavior is to wake from
274 idle on any event.
275
276 seat <name> keyboard_grouping none|smart
277 Set how the keyboards in the seat are grouped together. Currently,
278 there are two options. none will disable all keyboard grouping.
279 This will make it so each keyboard device has its own isolated
280 state. smart will group the keyboards in the seat by their keymap
281 and repeat info. This is useful for when the keyboard appears as
282 multiple separate input devices. In this mode, the effective layout
283 is synced between the keyboards in the group. The default is smart.
284 To restore the behavior of older versions of sway, use none.
285
286 seat <name> pointer_constraint enable|disable|escape
287 Enables or disables the ability for clients to capture the cursor
288 (enabled by default) for the seat. This is primarily useful for
289 video games. The "escape" command can be used at runtime to escape
290 from a captured client.
291
292 seat <name> shortcuts_inhibitor enable|disable|activate|deactivate|tog‐
293 gle
294 Enables or disables the ability of clients to inhibit keyboard
295 shortcuts for the seat. This is primarily useful for virtualization
296 and remote desktop software. Subcommands enable and disable affect
297 whether future inhibitors are honoured by default, i.e. activated
298 automatically, the default being enable. When used at runtime, dis‐
299 able also disables any currently active inhibitors. activate, deac‐
300 tivate and toggle are only usable at runtime and change the state
301 of a potentially existing inhibitor on the currently focused win‐
302 dow. This can be used with the current seat alias (-) to affect
303 only the currently focused window of the current seat. Subcommand
304 deactivate is particularly useful in an --inhibited bindsym to es‐
305 cape a state where shortcuts are inhibited and the client becomes
306 uncooperative. It is worth noting that whether disabled or deacti‐
307 vated inhibitors are removed is entirely up to the client. Depend‐
308 ing on the client it may therefore be possible to (re-)activate
309 them later. Any visual indication that an inhibitor is present is
310 currently left to the client as well.
311
312 seat <name> xcursor_theme <theme> [<size>]
313 Override the system default XCursor theme. The default seat's
314 (seat0) theme is also used as the default cursor theme in XWayland,
315 and exported through the XCURSOR_THEME and XCURSOR_SIZE environment
316 variables.
317
319 sway(5) sway-output(5) xkeyboard-config(7)
320
321
322
323 2023-02-12 sway-input(5)