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 <n>
38 Sets the delay before repeating a held-down key, in milliseconds.
39
40 input <identifier> repeat_rate <n>
41 Sets the key repeat rate in number of keypresses per second.
42
43 For more information on these xkb configuration options, see xkeyboard-
44 config(7).
45
46 input <identifier> xkb_layout <layout_name>
47 Sets the layout of the keyboard like us or de.
48
49 input <identifier> xkb_model <model_name>
50 Sets the model of the keyboard. This has an influence for some
51 extra keys your keyboard might have.
52
53 input <identifier> xkb_options <options>
54 Sets extra xkb configuration options for the keyboard.
55
56 input <identifier> xkb_rules <rules>
57 Sets files of rules to be used for keyboard mapping composition.
58
59 input <identifier> xkb_variant <variant>
60 Sets the variant of the keyboard like dvorak or colemak.
61
62 The following commands may only be used in the configuration file.
63
64 input <identifier> xkb_capslock enabled|disabled
65 Initially enables or disables CapsLock on startup, the default is
66 disabled.
67
68 input <identifier> xkb_numlock enabled|disabled
69 Initially enables or disables NumLock on startup, the default is
70 disabled.
71
72 MAPPING CONFIGURATION
73 input <identifier> map_to_output <identifier>
74 Maps inputs from this device to the specified output. Only meaning‐
75 ful if the device is a pointer, touch, or drawing tablet device.
76
77 input <identifier> map_to_region <WxH@X,Y>
78 Maps inputs from this device to the specified region of the global
79 output layout. Only meaningful if the device is a pointer, touch,
80 or drawing tablet device.
81
82 input <identifier> map_from_region <X1xY1> <X2xY2>
83 Ignores inputs from this device that do not occur within the speci‐
84 fied region. Can be in millimeters (e.g. 10x20mm 20x40mm) or in
85 terms of 0..1 (e.g. 0.5x0.5 0.7x0.7). Not all devices support mil‐
86 limeters. Only meaningful if the device is not a keyboard an pro‐
87 vides events in absolute terms (such as a drawing tablet or touch
88 screen - most pointers provide events relative to the previous
89 frame).
90
91 LIBINPUT CONFIGURATION
92 input <identifier> accel_profile adaptive|flat
93 Sets the pointer acceleration profile for the specified input
94 device.
95
96 input <identifier> click_method none|button_areas|clickfinger
97 Changes the click method for the specified device.
98
99 input <identifier> drag enabled|disabled
100 Enables or disables tap-and-drag for specified input device.
101
102 input <identifier> drag_lock enabled|disabled
103 Enables or disables drag lock for specified input device.
104
105 input <identifier> dwt enabled|disabled
106 Enables or disables disable-while-typing for the specified input
107 device.
108
109 input <identifier> events enabled|disabled|disabled_on_exter‐
110 nal_mouse|toggle [<toggle-modes>]
111 Enables or disables send_events for specified input device. Dis‐
112 abling send_events disables the input device.
113
114 The toggle option cannot be used in the config. If no toggle modes
115 are listed, all supported modes for the device will be toggled
116 through in the order: enabled, disabled_on_external_mouse, dis‐
117 abled, (loop back). If toggle modes are listed, they will be cycled
118 through, defaulting to the first mode listed if the current mode is
119 not in the list. They will also not be checked to see if they are
120 supported for the device and may fail.
121
122 input <identifier> left_handed enabled|disabled
123 Enables or disables left handed mode for specified input device.
124
125 input <identifier> middle_emulation enabled|disabled
126 Enables or disables middle click emulation.
127
128 input <identifier> natural_scroll enabled|disabled
129 Enables or disables natural (inverted) scrolling for the specified
130 input device.
131
132 input <identifier> pointer_accel [<-1|1>]
133 Changes the pointer acceleration for the specified input device.
134
135 input <identifier> repeat_delay <milliseconds>
136 Sets the amount of time a key must be held before it starts repeat‐
137 ing.
138
139 input <identifier> repeat_rate <characters per second>
140 Sets the frequency of key repeats once the repeat_delay has passed.
141
142 input <identifier> scroll_button disable|button[1-3,8,9]|<event-code-
143 or-name>
144 Sets the button used for scroll_method on_button_down. The button
145 can be given as an event name or code, which can be obtained from
146 `libinput debug-events`, or as a x11 mouse button (but‐
147 ton[1-3,8,9]). If set to disable, it disables the scroll_method
148 on_button_down.
149
150 input <identifier> scroll_factor <floating point value>
151 Changes the scroll factor for the specified input device. Scroll
152 speed will be scaled by the given value, which must be non-nega‐
153 tive.
154
155 input <identifier> scroll_method none|two_finger|edge|on_button_down
156 Changes the scroll method for the specified input device.
157
158 input <identifier> tap enabled|disabled
159 Enables or disables tap for specified input device.
160
161 input <identifier> tap_button_map lrm|lmr
162 Specifies which button mapping to use for tapping. lrm treats 1
163 finger as left click, 2 fingers as right click, and 3 fingers as
164 middle click. lmr treats 1 finger as left click, 2 fingers as mid‐
165 dle click, and 3 fingers as right click.
166
167 SEAT CONFIGURATION
168 Configure options for multiseat mode.
169
170 A seat is a collection of input devices that act independently of each
171 other. Seats are identified by name and the default seat is seat0 if
172 no seats are configured. While sway is running, - (hyphen) can be used
173 as an alias for the current seat. Each seat has an independent keyboard
174 focus and a separate cursor that is controlled by the pointer devices
175 of the seat. This is useful for multiple people using the desktop at
176 the same time with their own devices (each sitting in their own
177 "seat"). The wildcard character, *, can also be used in place of <iden‐
178 tifier> to change settings for all seats.
179
180 Tip: If the configuration settings do not appear to be taking effect,
181 you could try using * instead of <identifier>. If it works with the
182 wildcard, try using a different identifier from swaymsg -t get_seats
183 until you find the correct seat.
184
185 seat <name> attach <input_identifier>
186 Attach an input device to this seat by its input identifier. A spe‐
187 cial value of "*" will attach all devices to the seat.
188
189 seat <seat> cursor move|set <x> <y>
190 Move specified seat's cursor relative to current position or wrap
191 to absolute coordinates (with respect to the global coordinate
192 space). Specifying either value as 0 will not update that coordi‐
193 nate.
194
195 seat <seat> cursor press|release button[1-9]|<event-name-or-code>
196 Simulate pressing (or releasing) the specified mouse button on the
197 specified seat. The button can either be provided as a button event
198 name or event code, which can be obtained from `libinput debug-
199 events`, or as an x11 mouse button (button[1-9]). If using but‐
200 ton[4-7], which map to axes, an axis event will be simulated, how‐
201 ever press and release will be ignored and both will occur.
202
203 seat <name> fallback true|false
204 Set this seat as the fallback seat. A fallback seat will attach any
205 device not explicitly attached to another seat (similar to a
206 "default" seat).
207
208 seat <name> hide_cursor <timeout>
209 Hides the cursor image after the specified timeout (in millisec‐
210 onds) has elapsed with no activity on that cursor. A timeout of 0
211 (default) disables hiding the cursor. The minimal timeout is 100
212 and any value less than that (aside from 0), will be increased to
213 100.
214
215 seat <name> pointer_constraint enable|disable|escape
216 Enables or disables the ability for clients to capture the cursor
217 (enabled by default) for the seat. This is primarily useful for
218 video games. The "escape" command can be used at runtime to escape
219 from a captured client.
220
222 sway(5) sway-output(5) xkeyboard-config(7)
223
224
225
226 2019-07-27 sway-input(5)