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