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