|sway-input(5)||File Formats Manual||sway-input(5)|
NAME¶sway-input - input configuration file and commands
DESCRIPTION¶Sway allows for configuration of devices within the sway configuration file. To obtain a list of available device identifiers, run swaymsg -t get_inputs. Settings can also be applied to all input devices by using the wildcard, *, in place of <identifier> in the commands below. In addition, the settings can be applied to a type of device, by using type:<input_type> in place of <identifier>.
In the configuration file, settings with a more specific selector take precedence over more general ones: <identifier> > type:<input_type> > *. When executing input commands, however, the settings are applied to all matching input devices! This means that type:<input_type> can override previously set <identifier> settings, even though in a configuration file they would take precedence. Similarly * can override both <identifier> and type:<input_type> settings, if applied later.
Tip: If the configuration settings do not appear to be taking effect, you could try using * instead of <identifier>. If it works with the wildcard, try using a different identifier from swaymsg -t get_inputs until you find the correct input device.
Current available input types are:
Note: The type configurations are applied as the devices appear and get applied on top of the existing device configurations.
KEYBOARD CONFIGURATION¶input <identifier> repeat_delay <milliseconds>
input <identifier> repeat_rate <characters per second>
For more information on these xkb configuration options, see xkeyboard-config(7).
input <identifier> xkb_file <file_name>
input <identifier> xkb_layout <layout_name>
Multiple layouts can be specified by separating them with commas.
input <identifier> xkb_model <model_name>
input <identifier> xkb_options <options>
Multiple options can be specified by separating them with commas.
input <identifier> xkb_rules <rules>
input <identifier> xkb_switch_layout <index>|next|prev
This can be used when multiple layouts are configured with xkb_layout. A list of layouts you can switch between can be obtained with swaymsg -t get_inputs.
input <identifier> xkb_variant <variant>
The following commands may only be used in the configuration file.
input <identifier> xkb_capslock enabled|disabled
input <identifier> xkb_numlock enabled|disabled
TABLET CONFIGURATION¶input <identifier> tool_mode <tool> <absolute|relative>
Valid values for <tool> are currently "pen", "eraser", "brush", "pencil", "airbrush", and the wildcard *, which matches all tools.
Mouse and lens tools ignore this setting and are always treated as relative.
MAPPING CONFIGURATION¶input <identifier> map_to_output <identifier>
The wildcard * can be used to map the input device to the whole desktop layout.
input <identifier> map_to_region <X> <Y> <width> <height>
input <identifier> map_from_region <X1xY1> <X2xY2>
LIBINPUT CONFIGURATION¶input <identifier> accel_profile adaptive|flat
input <identifier> calibration_matrix <6 space-separated floating point values>
input <identifier> click_method none|button_areas|clickfinger
input <identifier> drag enabled|disabled
input <identifier> drag_lock enabled|disabled
input <identifier> dwt enabled|disabled
input <identifier> events enabled|disabled|disabled_on_external_mouse|toggle [<toggle-modes>]
The toggle option cannot be used in the config. If no toggle modes are listed, all supported modes for the device will be toggled through in the order: enabled, disabled_on_external_mouse, disabled, (loop back). If toggle modes are listed, they will be cycled through, defaulting to the first mode listed if the current mode is not in the list. They will also not be checked to see if they are supported for the device and may fail.
input <identifier> left_handed enabled|disabled
input <identifier> middle_emulation enabled|disabled
input <identifier> natural_scroll enabled|disabled
input <identifier> pointer_accel [<-1|1>]
input <identifier> scroll_button disable|button[1-3,8,9]|<event-code-or-name>
input <identifier> scroll_factor <floating point value>
input <identifier> scroll_method none|two_finger|edge|on_button_down
input <identifier> tap enabled|disabled
input <identifier> tap_button_map lrm|lmr
SEAT CONFIGURATION¶Configure options for multiseat mode.
A seat is a collection of input devices that act independently of each other. Seats are identified by name and the default seat is seat0 if no seats are configured. While sway is running, - (hyphen) can be used as an alias for the current seat. Each seat has an independent keyboard focus and a separate cursor that is controlled by the pointer devices of the seat. This is useful for multiple people using the desktop at the same time with their own devices (each sitting in their own "seat"). The wildcard character, *, can also be used in place of <identifier> to change settings for all seats.
Tip: If the configuration settings do not appear to be taking effect, you could try using * instead of <identifier>. If it works with the wildcard, try using a different identifier from swaymsg -t get_seats until you find the correct seat.
seat <name> attach <input_identifier>
seat <seat> cursor move|set <x> <y>
seat <seat> cursor press|release button[1-9]|<event-name-or-code>
seat <name> fallback true|false
seat <name> hide_cursor <timeout>|when-typing [enable|disable]
If timeout is specified, then the cursor will be hidden after timeout (in milliseconds) has elapsed with no activity on the cursor. A timeout of 0 (default) disables hiding the cursor. The minimal timeout is 100 and any value less than that (aside from 0), will be increased to 100.
If when-typing is enabled, then the cursor will be hidden whenever a key is pressed.
seat <name> idle_inhibit <sources...>
seat <name> idle_wake <sources...>
seat <name> keyboard_grouping none|smart
seat <name> pointer_constraint enable|disable|escape
seat <name> shortcuts_inhibitor enable|disable|activate|deactivate|toggle
seat <name> xcursor_theme <theme> [<size>]
SEE ALSO¶sway(5) sway-output(5) xkeyboard-config(7)