# Mouse keys

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Mouse_keys
> Markdown URL: https://mediated.wiki/source/Mouse_keys.md
> Source: https://en.wikipedia.org/wiki/Mouse_keys
> Source revision: 1239469136
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Feature of some graphical user interfaces that uses the keyboard as a pointing device

**Mouse keys** is a feature of some [graphical user interfaces](/source/Graphical_user_interface) that uses the keyboard (especially [numeric keypad](/source/Numeric_keypad)) as a [pointing device](/source/Pointing_device) (usually replacing a [mouse](/source/Computer_mouse)). Its roots lie in the earliest days of [visual editors](/source/Visual_editor) when line and column navigation was controlled with [arrow keys](/source/Arrow_keys). Today, mouse keys usually refers to the numeric keypad layout standardized with the introduction of the [X Window System](/source/X_Window_System) in 1984.[1][2]

## Layout

X window system MouseKeys default numpad layout

key action Num Lock with Alt+⇧ Shift enable/disable MouseKeys 8 cursor up 2 cursor down 6 cursor right 4 cursor left 7 cursor up and left 9 cursor up and right 3 cursor down and right 1 cursor down and left / select primary button * select modifier button - select alternate button 5 click selected button + double click selected button 0 depress selected button . release selected button ↵ Enter enter key

## History

Historically, MouseKeys supported GUI programs when many [terminals](/source/Computer_terminal#Graphical_terminals) had no dedicated [pointing device](/source/Pointing_device). As pointing devices became ubiquitous, the use of mouse keys narrowed to situations where a pointing device was missing, unusable, or inconvenient. Such situations may arise from the following:

- precision requirements (e.g., [technical drawing](/source/Technical_drawing))

- [disabled user](/source/Accessibility) or ergonomics issues

- environmental limits (e.g., vibration in car or plane)

- broken/missing/unavailable equipment

In 1987, Macintosh Operating System 4.2 Easy Access provided MouseKeys support to all applications. Easy access was (de)activated by clicking the ⇧ Shift key five times.[*[citation needed](https://en.wikipedia.org/wiki/Wikipedia:Citation_needed)*]

By the early 2020s, with [graphics tablets](/source/Graphics_tablet) becoming more common, a configuration change may be required before enabling MouseKeys.[*[citation needed](https://en.wikipedia.org/wiki/Wikipedia:Citation_needed)*]

## MouseKeysAccel

X window system MouseKeysAccel trajectory

parameter meaning mk_delay milliseconds between the initial key press and first repeated motion event mk_interval milliseconds between repeated motion events mk_max_speed steady speed (in action_delta units) applied each event mk_time_to_max number of events (count) accelerating to steady speed mk_curve ramp used to reach maximum pointer speed

The [X Window System](/source/X_Window_System) MouseKeysAccel control applies action (usually cursor movement) repeatedly while a direction key {1,2,3,4,6,7,8,9} remains depressed.[3] When the key is depressed, an *action_delta* is immediately applied. If the key remains depressed, longer than *mk_delay* milliseconds, some action is applied every *mk_interval* milliseconds until the key is released. If the key remains depressed, after more than *mk_time_to_max* actions have been applied, *action_delta* magnified *mk_max_speed* times, is applied every *mk_interval* milliseconds.

The first *mk_time_to_max* actions increase smoothly according to an exponential.

a c t i o n _ d e l t a × m k _ m a x _ s p e e d × ( i m k _ t i m e _ t o _ m a x ) 1000 + m k _ c u r v e 1000 {\displaystyle \mathrm {action\_delta} \times \mathrm {mk\_max\_speed} \times \left({\frac {i}{\mathrm {mk\_time\_to\_max} }}\right)^{\frac {1000+\mathrm {mk\_curve} }{1000}}}

mk_curve result -1000 uniform speed, linearly increasing action 0 uniform acceleration, linearly increasing speed 1000 uniform jerk, linearly increasing acceleration

These five parameters are configurable.[4]

## Enabling

Under the [X Window Systems](/source/X_Window_System) [X.Org](/source/X.Org_Server) and [XFree86](/source/XFree86) used on [Unix-like](/source/Unix-like) systems such as [Linux](/source/Linux), [BSD](/source/Berkeley_Software_Distribution), and [AIX](/source/IBM_AIX), MouseKeys (and MouseKeysAccel), when available, is nominally (de)activated by Alt+⇧ Shift+Num Lock.[5] MouseKeys without acceleration (also known as plot mode) is sometimes available with ⇧ Shift+Num Lock. This is nominally independent of the [window manager](/source/Window_manager) in use, but may be overridden, or even made unavailable by a [configuration file](/source/Configuration_file).

Before enabling, it may be necessary to change system configuration. The [setxkbmap](https://www.x.org/archive/X11R7.7/doc/man/man1/setxkbmap.1.xhtml) utility can be used to change the configuration under Xorg:[6]

setxkbmap -option keypad:pointerkeys

There are also various utilities to allow more precise control via user-configurable key bindings, such as [xmousekeys](https://beesbuzz.biz/code/269-xmousekeys) and [xdotool](https://www.semicomplete.com/projects/xdotool/).

Since [KDE 5](/source/KDE_Plasma_5), MouseKeys is enabled and configured by systemsetting5[7] (Hardware → Input Devices → Mouse → Keyboard Navigation)

MouseKeys for [Apple Inc.](/source/Apple_Inc.)'s [macOS](/source/MacOS) is enabled and configured via the [Accessibility](/source/Accessibility)[8] ([apple] → System Preferences → Accessibility → Mouse & Trackpad).

[Microsoft](/source/Microsoft) changed the method of enabling between [Windows 2000](/source/Windows_2000),[9] [Windows XP](/source/Windows_XP) (added diagonal cursor movement and MouseKeysAccel),[10] and [Windows Vista](/source/Windows_Vista).[11]

## Common usage

### Replacing the mouse keys

Replacing the mouse keys by the numeric keypad is as follows:

Typing 5 (with the numeric keypad) is equivalent to clicking the selected button. By default, the selected button is the primary button (nominally under [index finger](/source/Index_finger), left button for most right-handed people and right button for most left-handed people). Typing - (with the numeric keypad) selects the alternate button (nominally under [ring finger](/source/Ring_finger), right button for most right-handed people and left button for most left-handed people). Typing * (with the numeric keypad) selects the modifier button (nominally under the [middle finger](/source/Middle_finger), middle button of a 3-button mouse). Typing / (with the numeric keypad) selects the primary button. The selection remains in effect until a different button is selected.

Assignment of left/middle/right button to primary/modifier/alternate, alternate/modifier/primary, or something else is settable by many means. Some mice have a switch, that swaps assignment of right and left keys. Many laptop bioses have a setting for mouse button assignment. Many window managers have a setting that permutes the assignment. Within the [X Window System core protocol](/source/X_Window_System_core_protocol), permutation can be applied by [xmodmap](https://www.x.org/archive/X11R7.7/doc/man/man1/xmodmap.1.xhtml).

### Moving the pointer by keys

Other than 5, all other numeric keys from the numeric keypad are used to move the pointer on the screen. For example, 8 will move the pointer upwards, while 1 will move it diagonally downwards to the left.

## See also

- [FilterKeys](/source/FilterKeys) – Accessibility feature of Microsoft Windows

- [Sticky keys](/source/Sticky_keys) – Accessibility feature

- [ToggleKeys](/source/ToggleKeys) – Accessibility function for Microsoft Windows

- [Virtual keyboard](/source/Virtual_keyboard) – Software component

## References

1. **[^](#cite_ref-1)** [The X Keyboard Extension: Protocol Specification](https://www.xfree86.org/current/XKBproto.pdf)

1. **[^](#cite_ref-2)** [The X Keyboard Extension: Library Specification](https://www.xfree86.org/current/XKBlib.pdf)

1. **[^](#cite_ref-3)** The X Keyboard Extension: Library Specification, Library Version 1.0/Document Revision 1.1, X Consortium Standard, X Version 11 / Release 6.4, Keyboard Controls, 10.5.2, [The MouseKeysAccel Control](https://www.x.org/releases/X11R7.6/doc/libX11/specs/XKB/xkblib.html#the_mousekeysaccel_control)

1. **[^](#cite_ref-4)** [GNOME Documentation Library, Configuring a Keyboard-Based Mouse](http://library.gnome.org/users/gnome-access-guide/stable/dtconfig-mousekeys.html.en) [Archived](https://web.archive.org/web/20100612115254/http://library.gnome.org/users/gnome-access-guide/stable/dtconfig-mousekeys.html.en) 2010-06-12 at the [Wayback Machine](/source/Wayback_Machine)

1. **[^](#cite_ref-5)** The X Keyboard Extension: Library Specification, Library Version 1.0/Document Revision 1.1, X Consortium Standard, X Version 11 / Release 6.4, Keyboard Controls, 10.5.1, [The MouseKeys Control](https://www.x.org/releases/X11R7.6/doc/libX11/specs/XKB/xkblib.html#the_mousekeys_control)

1. **[^](#cite_ref-6)** ["xkeyboard-config manual page"](https://manpages.ubuntu.com/manpages/jammy/en/man7/xkeyboard-config.7.html). 2012. Retrieved 15 March 2015.

1. **[^](#cite_ref-7)** [KDE.org, Using System Settings, System Settings Categories and Modules](https://docs.kde.org/trunk5/en/systemsettings/systemsettings/general.html)

1. **[^](#cite_ref-8)** [Apple.com, Mac OS X, Accessibility](https://www.apple.com/accessibility/macosx/physical.html)

1. **[^](#cite_ref-9)** Microsoft.com, Accessibility Tutorials, Windows 2000, [Turning MouseKeys On and Off](http://www.microsoft.com/enable/training/windows2000/default.aspx)

1. **[^](#cite_ref-10)** Microsoft.com, Accessibility Tutorials, Windows XP, [MouseKeys: Control the Mouse Pointer Using the Numeric Keypad](http://www.microsoft.com/enable/training/windowsxp/mousekeys.aspx)

1. **[^](#cite_ref-11)** Microsoft.com, Accessibility Tutorials, Windows Vista, [Control the mouse pointer with the keyboard (Mouse Keys)](http://www.microsoft.com/enable/training/windowsvista/mousekeys.aspx)

---
Adapted from the Wikipedia article [Mouse keys](https://en.wikipedia.org/wiki/Mouse_keys) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Mouse_keys?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
