mangowmmangowm

Input Devices

Configure keyboard layouts, mouse sensitivity, and touchpad gestures.

Device Configuration

The global settings below apply to every device of the corresponding type. Per-device overrides are covered in the Device Rules section at the end of this page.

Keyboard Settings

Control key repeat rates and layout rules.

SettingTypeDefaultDescription
repeat_rateint25How many times a key repeats per second.
repeat_delayint600Delay (ms) before a held key starts repeating.
numlockon0 or 10Enable NumLock on startup.
xkb_rules_rulesstring-XKB rules file (e.g., evdev, base). Usually auto-detected.
xkb_rules_modelstring-Keyboard model (e.g., pc104, macbook).
xkb_rules_layoutstring-Keyboard layout code (e.g., us, de, us,de).
xkb_rules_variantstring-Layout variant (e.g., dvorak, colemak, intl).
xkb_rules_optionsstring-XKB options (e.g., caps:escape, ctrl:nocaps).

Example:

repeat_rate=40
repeat_delay=300
numlockon=1
xkb_rules_layout=us,de
xkb_rules_variant=dvorak
xkb_rules_options=caps:escape,ctrl:nocaps

Mouse Settings

Configuration for external mice.

SettingDefaultDescription
mouse_natural_scrolling0Invert scrolling direction.
mouse_accel_profile20 (None), 1 (Flat), 2 (Adaptive).
mouse_accel_speed0.0Speed adjustment (-1.0 to 1.0).
mouse_left_handed0Swap left and right buttons.
mouse_middle_button_emulation0Emulate middle button.
mouse_scroll_method11 (Two-finger), 2 (Edge), 4 (Button).
mouse_scroll_button274The button used for button scrolling (272–279).
mouse_click_method11 (Button areas), 2 (Clickfinger).
mouse_send_events_mode00 (Enabled), 1 (Disabled), 2 (Disabled on external mouse).
axis_scroll_factor1.0Scroll factor for axis scroll speed (0.1–10.0).

Trackpad Settings

Specific settings for laptop touchpads. Some settings may require a relogin to take effect.

SettingDefaultDescription
disable_trackpad0Set to 1 to disable the trackpad entirely.
tap_to_click1Tap to trigger a left click.
tap_and_drag1Tap and hold to drag items.
trackpad_natural_scrolling0Invert scrolling direction (natural scrolling).
trackpad_accel_profile20 (None), 1 (Flat), 2 (Adaptive).
trackpad_accel_speed0.0Speed adjustment (-1.0 to 1.0).
trackpad_scroll_button274The button used for button scrolling (272–279).
trackpad_scroll_method11 (Two-finger), 2 (Edge), 4 (Button).
trackpad_click_method11 (Button areas), 2 (Clickfinger).
trackpad_send_events_mode00 (Enabled), 1 (Disabled), 2 (Disabled on external mouse).
drag_lock1Lock dragging after tapping.
trackpad_disable_while_typing1Disable trackpad while typing.
trackpad_left_handed0Swap left/right buttons.
trackpad_middle_button_emulation0Emulate middle button.
swipe_min_threshold1Minimum swipe threshold when use gesture.
button_map00 (Left/right/middle), 1 (Left/middle/right).
trackpad_scroll_factor1.0Scroll factor for trackpad scroll speed (0.1–10.0).

Touchscreen Settings

Settings for touchscreen devices. Touch input is forwarded to clients that support the wl_touch protocol; otherwise it falls back to mouse emulation so the touchscreen keeps working with non-touch clients.

SettingDefaultDescription
touch_enable1Set to 0 to completely disable touchscreen support.
touch_enable_mouse_emulation0When 1, touch events landing on surfaces that do not accept touch are emulated as left mouse button clicks/moves. Set to 0 to disable emulation (such touches are ignored).
touch_map_to_mon(unset)Restrict a touchscreen to one output. Accepts a monitor spec. Leave unset to map the touchscreen to the whole output layout. Useful on multi-monitor setups where the touchscreen would otherwise be stretched across all outputs.

Detailed descriptions:

  • scroll_button values (use mouse_scroll_button / trackpad_scroll_button):

    • 272 — Left button.
    • 273 — Right button.
    • 274 — Middle button.
    • 275 — Side button.
    • 276 — Extra button.
    • 277 — Forward button.
    • 278 — Back button.
    • 279 — Task button.
  • scroll_method values (use mouse_scroll_method / trackpad_scroll_method):

    • 0 — Never send scroll events (no scrolling).
    • 1 — Two-finger scrolling: send scroll events when two fingers are logically down on the device.
    • 2 — Edge scrolling: send scroll events when a finger moves along the bottom or right edge.
    • 4 — Button scrolling: send scroll events when a button is held and the device moves along a scroll axis.
  • click_method values (use mouse_click_method / trackpad_click_method):

    • 0 — No software click emulation.
    • 1 — Button areas: use software-defined areas on the touchpad to generate button events.
    • 2 — Clickfinger: the number of fingers determines which button is pressed.
  • mouse_accel_profile or trackpad_scroll_profile values:

    • 0 — No acceleration.
    • 1 — Flat: no dynamic acceleration. Pointer speed = original input speed × (1 + mouse_accel_speed).
    • 2 — Adaptive: slow movement results in less acceleration, fast movement results in more.
  • button_map values:

    • 0 — 1/2/3 finger tap maps to left / right / middle.
    • 1 — 1/2/3 finger tap maps to left / middle / right.
  • send_events_mode values (use mouse_send_events_mode / trackpad_send_events_mode):

    • 0 — Send events from this device normally.
    • 1 — Do not send events from this device.
    • 2 — Disable this device when an external pointer device is plugged in.


Keyboard Layout Switching

To bind multiple layouts and toggle between them, define the layouts in xkb_rules_layout and use xkb_rules_options to set a toggle key combination. Then bind switch_keyboard_layout to trigger a switch.

# Define two layouts: US QWERTY and US Dvorak
xkb_rules_layout=us,us
xkb_rules_variant=,dvorak
xkb_rules_options=grp:lalt_lshift_toggle

Or bind it manually to a key:

# Bind Alt+Shift_L to cycle keyboard layout
bind=alt,shift_l,switch_keyboard_layout

Use mmsg get keyboardlayout to query the current layout.


Input Method Editor (IME)

To use Fcitx5 or IBus, set these environment variables in your config file.

Info: These settings require a restart of the window manager to take effect.

For Fcitx5:

env=GTK_IM_MODULE,fcitx
env=QT_IM_MODULE,fcitx
env=QT_IM_MODULES,wayland;fcitx
env=SDL_IM_MODULE,fcitx
env=XMODIFIERS,@im=fcitx
env=GLFW_IM_MODULE,ibus

For IBus:

env=GTK_IM_MODULE,ibus
env=QT_IM_MODULE,ibus
env=XMODIFIERS,@im=ibus

Device Rules (Advanced)

The global settings above apply to every device of the corresponding type. Use devicerule to override parameters for a specific device.

Finding device names:

The easiest way to get a device's name is to watch for it: run

mmsg watch all-devices

then use the device (type on a keyboard, move a mouse, scroll a touchpad). Each event prints the name of the device that triggered it, so you can match every physical device to its name without guessing. mmsg get all-devices also lists all connected devices at once if you prefer.

Syntax:

devicerule=name:<device-name>,option:value,option:value
devicerule=type:<device-type>,option:value

Put the printed name after name: (the identifier field, vendor:product:name, also works). Use type: to match all devices of a type: keyboard, pointer, touchpad, touch, switch, tablet, pad.

Exact name: matches take priority over type: matches; the first matching rule wins. A rule with keyboard options (kb_*, repeat_*) turns that keyboard into an independent keyboard with its own keymap and repeat settings; unmatched devices stay in the shared, synchronized keyboard group.

Examples:

devicerule=name:AT Translated Set 2 keyboard,kb_layout:ru
devicerule=name:A4Tech USB Mouse,natural_scrolling:1,accel_speed:0.1
devicerule=type:touchpad,tap_to_click:1

Apply changes with mmsg dispatch reload_config or restart mango.

Rule Options

All options are optional; unset options fall back to the global settings. Keyboard kb_* options are independent of the global xkb_rules_* settings: a rule's keymap is compiled only from the options it sets (unset fields use the XKB defaults), so a rule like kb_layout:pt is not affected by a global xkb_rules_variant.

CategoryOptionDescription
Keyboardkb_layoutLayout code, e.g. us, ru, de
Keyboardkb_variantLayout variant, e.g. dvorak, colemak
Keyboardkb_optionsXKB options, e.g. caps:escape
Keyboardkb_rules / kb_modelXKB rules file / model
Keyboardrepeat_rate / repeat_delayKey repeat rate / delay
Pointeraccel_speedPointer speed, -1.0 to 1.0
Pointeraccel_profile0 none, 1 flat, 2 adaptive
Pointernatural_scrolling1 inverts scroll direction
Pointerleft_handed1 swaps left/right buttons
Touchpadtap_to_click1 enables tap-to-click
Touchpadtap_and_drag1 enables tap-and-drag
Touchpadscroll_method1 two-finger, 2 edge, 4 button
Touchpaddisable_while_typing1 disables the touchpad while typing
Commonmiddle_button_emulation1 emulates the middle button
Commonsend_events_mode0 enabled, 1 disabled, 2 disabled with external mouse
Commonscroll_button / click_method / drag_lock / button_maplibinput settings, see descriptions below

Info: If a rule's keyboard layout fails to compile (e.g. kb_layout:ru with kb_variant:dvorak), mango logs an error and falls back to the global layout instead of crashing.

On this page