266 lines
18 KiB
HTML
266 lines
18 KiB
HTML
<!DOCTYPE html>
|
|
<html class="no-js" lang="en">
|
|
<head>
|
|
<title>Mouse Keys - QMK Firmware</title>
|
|
<meta name="description" content="Keyboard controller firmware for Atmel AVR and ARM USB families">
|
|
<meta name="author" content="QMK Community">
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<link rel="icon" href="../themes/daux/img/favicon-navy.png" type="image/x-icon">
|
|
|
|
<!-- Mobile -->
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<!-- Font -->
|
|
|
|
<!-- CSS -->
|
|
<link href='../themes/daux/css/theme-navy.min.css' rel='stylesheet' type='text/css'>
|
|
<!-- Tipue Search -->
|
|
<link href="../tipuesearch/tipuesearch.css" rel="stylesheet">
|
|
|
|
<!--[if lt IE 9]>
|
|
<script src="../themes/daux/js/html5shiv-3.7.3.min.js"></script>
|
|
<![endif]-->
|
|
</head>
|
|
<body class=" ">
|
|
<div class="Columns content">
|
|
<aside class="Columns__left Collapsible">
|
|
<button type="button" class="Button Collapsible__trigger">
|
|
<span class="Collapsible__trigger__bar"></span>
|
|
<span class="Collapsible__trigger__bar"></span>
|
|
<span class="Collapsible__trigger__bar"></span>
|
|
</button>
|
|
|
|
<a class="Brand" href="../index.html">QMK Firmware</a>
|
|
|
|
<div class="Search">
|
|
<svg class="Search__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 451 451">
|
|
<path d="M447.05 428l-109.6-109.6c29.4-33.8 47.2-77.9 47.2-126.1C384.65 86.2 298.35 0 192.35 0 86.25 0 .05 86.3.05 192.3s86.3 192.3 192.3 192.3c48.2 0 92.3-17.8 126.1-47.2L428.05 447c2.6 2.6 6.1 4 9.5 4s6.9-1.3 9.5-4c5.2-5.2 5.2-13.8 0-19zM26.95 192.3c0-91.2 74.2-165.3 165.3-165.3 91.2 0 165.3 74.2 165.3 165.3s-74.1 165.4-165.3 165.4c-91.1 0-165.3-74.2-165.3-165.4z"/>
|
|
</svg>
|
|
<input type="search" id="tipue_search_input" class="Search__field" placeholder="Search..." autocomplete="on"
|
|
results=25 autosave=text_search>
|
|
</div>
|
|
|
|
<div class="Collapsible__content">
|
|
<!-- Navigation -->
|
|
<ul class='Nav'><li class='Nav__item has-children'><a href="../Getting_Started/index.html" class="folder"><i class="Nav__arrow"> </i>Getting Started</a><ul class='Nav'><li class='Nav__item has-children'><a href="../Getting_Started/Install_Build_Tools/index.html" class="folder"><i class="Nav__arrow"> </i>Install Build Tools</a><ul class='Nav'><li class='Nav__item '><a href="../Getting_Started/Install_Build_Tools/Vagrant.html">Vagrant</a></li></ul></li><li class='Nav__item '><a href="../Getting_Started/Build_Compile_Instructions.html">Build Compile Instructions</a></li><li class='Nav__item '><a href="../Getting_Started/Flashing_Firmware.html">Flashing Firmware</a></li><li class='Nav__item '><a href="../Getting_Started/Contributing.html">Contributing</a></li><li class='Nav__item '><a href="../Getting_Started/How_to_Use_GitHub.html">How to Use GitHub</a></li><li class='Nav__item '><a href="../Getting_Started/Getting_Help.html">Getting Help</a></li></ul></li><li class='Nav__item has-children'><a href="../Complete_Newbs_Guide/index.html" class="folder"><i class="Nav__arrow"> </i>Complete Newbs Guide</a><ul class='Nav'><li class='Nav__item '><a href="../Complete_Newbs_Guide/Complete_Newbie's_Guide.html">Complete Newbie's Guide</a></li><li class='Nav__item '><a href="../Complete_Newbs_Guide/Building_Your_First_Firmware.html">Building Your First Firmware</a></li><li class='Nav__item '><a href="../Complete_Newbs_Guide/Flashing_Firmware.html">Flashing Firmware</a></li><li class='Nav__item '><a href="../Complete_Newbs_Guide/Testing_and_Debugging.html">Testing and Debugging</a></li></ul></li><li class='Nav__item has-children'><a href="../FAQ/index.html" class="folder"><i class="Nav__arrow"> </i>FAQ</a><ul class='Nav'><li class='Nav__item '><a href="../FAQ/General_FAQ.html">General FAQ</a></li><li class='Nav__item '><a href="../FAQ/Build_Compile_QMK.html">Build Compile QMK</a></li><li class='Nav__item '><a href="../FAQ/Debugging_and_Troubleshooting.html">Debugging and Troubleshooting</a></li><li class='Nav__item '><a href="../FAQ/Keymaps.html">Keymaps</a></li></ul></li><li class='Nav__item has-children'><a href="../Hardware/index.html" class="folder"><i class="Nav__arrow"> </i>Hardware</a><ul class='Nav'><li class='Nav__item '><a href="../Hardware/AVR_Processors.html">AVR Processors</a></li><li class='Nav__item '><a href="../Hardware/Drivers.html">Drivers</a></li></ul></li><li class='Nav__item Nav__item--open has-children'><a href="../Features/index.html" class="folder"><i class="Nav__arrow"> </i>Features</a><ul class='Nav'><li class='Nav__item '><a href="../Features/Advanced_Keycodes.html">Advanced Keycodes</a></li><li class='Nav__item '><a href="../Features/Audio.html">Audio</a></li><li class='Nav__item '><a href="../Features/Auto_Shift.html">Auto Shift</a></li><li class='Nav__item '><a href="../Features/Backlight.html">Backlight</a></li><li class='Nav__item '><a href="../Features/Bluetooth.html">Bluetooth</a></li><li class='Nav__item '><a href="../Features/Bootmagic.html">Bootmagic</a></li><li class='Nav__item '><a href="../Features/Command.html">Command</a></li><li class='Nav__item '><a href="../Features/Dynamic_Macros.html">Dynamic Macros</a></li><li class='Nav__item '><a href="../Features/Grave_Escape.html">Grave Escape</a></li><li class='Nav__item '><a href="../Features/Key_Lock.html">Key Lock</a></li><li class='Nav__item '><a href="../Features/Layouts.html">Layouts</a></li><li class='Nav__item '><a href="../Features/Leader_Key.html">Leader Key</a></li><li class='Nav__item '><a href="../Features/Macros.html">Macros</a></li><li class='Nav__item Nav__item--active'><a href="../Features/Mouse_Keys.html">Mouse Keys</a></li><li class='Nav__item '><a href="../Features/Pointing_Device.html">Pointing Device</a></li><li class='Nav__item '><a href="../Features/PS_2_Mouse.html">PS 2 Mouse</a></li><li class='Nav__item '><a href="../Features/RGB_Lighting.html">RGB Lighting</a></li><li class='Nav__item '><a href="../Features/Space_Cadet_Shift.html">Space Cadet Shift</a></li><li class='Nav__item '><a href="../Features/Space_Cadet_Shift_Enter.html">Space Cadet Shift Enter</a></li><li class='Nav__item '><a href="../Features/Stenography.html">Stenography</a></li><li class='Nav__item '><a href="../Features/Swap_Hands.html">Swap Hands</a></li><li class='Nav__item '><a href="../Features/Tap_Dance.html">Tap Dance</a></li><li class='Nav__item '><a href="../Features/Terminal.html">Terminal</a></li><li class='Nav__item '><a href="../Features/Thermal_Printer.html">Thermal Printer</a></li><li class='Nav__item '><a href="../Features/Unicode.html">Unicode</a></li><li class='Nav__item '><a href="../Features/Userspace.html">Userspace</a></li></ul></li><li class='Nav__item has-children'><a href="../Keycodes/index.html" class="folder"><i class="Nav__arrow"> </i>Keycodes</a><ul class='Nav'><li class='Nav__item '><a href="../Keycodes/Advanced_Keycodes.html">Advanced Keycodes</a></li><li class='Nav__item '><a href="../Keycodes/Backlight.html">Backlight</a></li><li class='Nav__item '><a href="../Keycodes/Basic.html">Basic</a></li><li class='Nav__item '><a href="../Keycodes/Bluetooth.html">Bluetooth</a></li><li class='Nav__item '><a href="../Keycodes/Bootmagic.html">Bootmagic</a></li><li class='Nav__item '><a href="../Keycodes/Quantum_Keycodes.html">Quantum Keycodes</a></li><li class='Nav__item '><a href="../Keycodes/RGB_Lighting.html">RGB Lighting</a></li><li class='Nav__item '><a href="../Keycodes/Stenography.html">Stenography</a></li><li class='Nav__item '><a href="../Keycodes/Thermal_Printer.html">Thermal Printer</a></li><li class='Nav__item '><a href="../Keycodes/US_ANSI_Shifted_keys.html">US ANSI Shifted keys</a></li></ul></li><li class='Nav__item has-children'><a href="../Reference/index.html" class="folder"><i class="Nav__arrow"> </i>Reference</a><ul class='Nav'><li class='Nav__item '><a href="../Reference/Keyboard_Guidelines.html">Keyboard Guidelines</a></li><li class='Nav__item '><a href="../Reference/Compatable_Microcontrollers.html">Compatable Microcontrollers</a></li><li class='Nav__item '><a href="../Reference/Config_Options.html">Config Options</a></li><li class='Nav__item '><a href="../Reference/Custom_Code.html">Custom Code</a></li><li class='Nav__item '><a href="../Reference/Documentation_Best_Practices.html">Documentation Best Practices</a></li><li class='Nav__item '><a href="../Reference/Documentation_Templates.html">Documentation Templates</a></li><li class='Nav__item '><a href="../Reference/Glossary.html">Glossary</a></li><li class='Nav__item '><a href="../Reference/Keymap_Overview.html">Keymap Overview</a></li><li class='Nav__item '><a href="../Reference/Unit_Testing.html">Unit Testing</a></li></ul></li><li class='Nav__item has-children'><a href="../For_Makers_And_Modders/index.html" class="folder"><i class="Nav__arrow"> </i>For Makers And Modders</a><ul class='Nav'><li class='Nav__item '><a href="../For_Makers_And_Modders/Hand_Wiring_Guide.html">Hand Wiring Guide</a></li><li class='Nav__item '><a href="../For_Makers_And_Modders/ISP_Flashing_Guide.html">ISP Flashing Guide</a></li></ul></li><li class='Nav__item has-children'><a href="../IDEs/index.html" class="folder"><i class="Nav__arrow"> </i>IDEs</a><ul class='Nav'><li class='Nav__item '><a href="../IDEs/Eclipse.html">Eclipse</a></li></ul></li><li class='Nav__item has-children'><a href="../For_a_Deeper_Understanding/index.html" class="folder"><i class="Nav__arrow"> </i>For a Deeper Understanding</a><ul class='Nav'><li class='Nav__item '><a href="../For_a_Deeper_Understanding/How_Keyboards_Work.html">How Keyboards Work</a></li><li class='Nav__item '><a href="../For_a_Deeper_Understanding/Understanding_QMK.html">Understanding QMK</a></li></ul></li></ul>
|
|
|
|
<div class="Links">
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</aside>
|
|
<div class="Columns__right Columns__right--full">
|
|
<div class="Columns__right__content">
|
|
<div class="doc_content">
|
|
<article class="Page">
|
|
|
|
<div class="Page__header">
|
|
<h1><a href="../Features/index.html">Features</a> <svg class="Page__header--separator" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 477.175 477.175"><path d="M360.73 229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1 0s-5.3 13.8 0 19.1l215.5 215.5-215.5 215.5c-5.3 5.3-5.3 13.8 0 19.1 2.6 2.6 6.1 4 9.5 4 3.4 0 6.9-1.3 9.5-4l225.1-225.1c5.3-5.2 5.3-13.8.1-19z"/></svg> <a href="../Features/Mouse_Keys.html">Mouse Keys</a></h1>
|
|
<span class="EditOn">
|
|
<a href="https://github.com/qmk/qmk_firmware/blob/master/docs/05_Features/Mouse_Keys.md" target="_blank">
|
|
Edit on GitHub </a>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="s-content">
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_Mousekeys">Mousekeys</a></p>
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_Adding-Mousekeys-to-a-Keymap">Adding Mousekeys to a Keymap</a></p>
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_Adding-Mousekeys-Support-in-the">Adding Mousekeys Support in the <code>rules.mk</code></a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Mapping-Mouse-Actions-to-Keyboard-Keys">Mapping Mouse Actions to Keyboard Keys</a></p>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_Configuring-the-Behavior-of-Mousekeys">Configuring the Behavior of Mousekeys</a></p>
|
|
<ul class="TableOfContents">
|
|
<li>
|
|
<p><a href="#page_section_6"><code>MOUSEKEY_DELAY</code></a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_section_7"><code>MOUSEKEY_INTERVAL</code></a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_section_8"><code>MOUSEKEY_MAX_SPEED</code></a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_section_9"><code>MOUSEKEY_TIME_TO_MAX</code></a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_section_10"><code>MOUSEKEY_WHEEL_MAX_SPEED</code></a></p>
|
|
</li>
|
|
<li>
|
|
<p><a href="#page_section_11"><code>MOUSEKEY_WHEEL_TIME_TO_MAX</code></a></p>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h1 id="page_Mousekeys">Mousekeys</h1>
|
|
<p>Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions. QMK uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it <a href="https://en.wikipedia.org/wiki/Mouse_keys" class="Link--external">on Wikipedia</a>.</p>
|
|
<h2 id="page_Adding-Mousekeys-to-a-Keymap">Adding Mousekeys to a Keymap</h2>
|
|
<p>There are two steps to adding Mousekeys support to your keyboard. You must enable support in the <code>rules.mk</code> file and you must map mouse actions to keys on your keyboard.</p>
|
|
<h3 id="page_Adding-Mousekeys-Support-in-the">Adding Mousekeys Support in the <code>rules.mk</code></h3>
|
|
<p>To add support for Mousekeys you simply need to add a single line to your keymap's <code>rules.mk</code>:</p>
|
|
<pre><code>MOUSEKEY_ENABLE = yes
|
|
</code></pre>
|
|
<p>You can see an example here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/rules.mk</p>
|
|
<h3 id="page_Mapping-Mouse-Actions-to-Keyboard-Keys">Mapping Mouse Actions to Keyboard Keys</h3>
|
|
<p>You can use these keycodes within your keymap to map button presses to mouse actions:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Key</th>
|
|
<th>Aliases</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>KC_MS_UP</code></td>
|
|
<td><code>KC_MS_U</code></td>
|
|
<td>Mouse Cursor Up</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_DOWN</code></td>
|
|
<td><code>KC_MS_D</code></td>
|
|
<td>Mouse Cursor Down</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_LEFT</code></td>
|
|
<td><code>KC_MS_L</code></td>
|
|
<td>Mouse Cursor Left</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_RIGHT</code></td>
|
|
<td><code>KC_MS_R</code></td>
|
|
<td>Mouse Cursor Right</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_BTN1</code></td>
|
|
<td><code>KC_BTN1</code></td>
|
|
<td>Mouse Button 1</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_BTN2</code></td>
|
|
<td><code>KC_BTN2</code></td>
|
|
<td>Mouse Button 2</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_BTN3</code></td>
|
|
<td><code>KC_BTN3</code></td>
|
|
<td>Mouse Button 3</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_BTN4</code></td>
|
|
<td><code>KC_BTN4</code></td>
|
|
<td>Mouse Button 4</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_BTN5</code></td>
|
|
<td><code>KC_BTN5</code></td>
|
|
<td>Mouse Button 5</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_WH_UP</code></td>
|
|
<td><code>KC_WH_U</code></td>
|
|
<td>Mouse Wheel Up</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_WH_DOWN</code></td>
|
|
<td><code>KC_WH_D</code></td>
|
|
<td>Mouse Wheel Down</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_WH_LEFT</code></td>
|
|
<td><code>KC_WH_L</code></td>
|
|
<td>Mouse Wheel Left</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_WH_RIGHT</code></td>
|
|
<td><code>KC_WH_R</code></td>
|
|
<td>Mouse Wheel Right</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_ACCEL0</code></td>
|
|
<td><code>KC_ACL0</code></td>
|
|
<td>Set mouse acceleration to 0</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_ACCEL1</code></td>
|
|
<td><code>KC_ACL1</code></td>
|
|
<td>Set mouse acceleration to 1</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>KC_MS_ACCEL2</code></td>
|
|
<td><code>KC_ACL2</code></td>
|
|
<td>Set mouse acceleration to 2</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>You can see an example in the <code>_ML</code> here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c#L46</p>
|
|
<h2 id="page_Configuring-the-Behavior-of-Mousekeys">Configuring the Behavior of Mousekeys</h2>
|
|
<p>The default speed for controlling the mouse with the keyboard is intentionally slow. You can adjust these parameters by adding these settings to your keymap's <code>config.h</code> file. All times are specified in milliseconds (ms).</p>
|
|
<pre><code>#define MOUSEKEY_DELAY 300
|
|
#define MOUSEKEY_INTERVAL 50
|
|
#define MOUSEKEY_MAX_SPEED 10
|
|
#define MOUSEKEY_TIME_TO_MAX 20
|
|
#define MOUSEKEY_WHEEL_MAX_SPEED 8
|
|
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
|
|
</code></pre>
|
|
<h3 id="page_section_6"><code>MOUSEKEY_DELAY</code></h3>
|
|
<p>When one of the mouse movement buttons is pressed this setting is used to define the delay between that button press and the mouse cursor moving. Some people find that small movements are impossible if this setting is too low, while settings that are too high feel sluggish.</p>
|
|
<h3 id="page_section_7"><code>MOUSEKEY_INTERVAL</code></h3>
|
|
<p>When a movement key is held down this specifies how long to wait between each movement report. Lower settings will translate into an effectively higher mouse speed.</p>
|
|
<h3 id="page_section_8"><code>MOUSEKEY_MAX_SPEED</code></h3>
|
|
<p>As a movement key is held down the speed of the mouse cursor will increase until it reaches <code>MOUSEKEY_MAX_SPEED</code>.</p>
|
|
<h3 id="page_section_9"><code>MOUSEKEY_TIME_TO_MAX</code></h3>
|
|
<p>How long you want to hold down a movement key for until <code>MOUSEKEY_MAX_SPEED</code> is reached. This controls how quickly your cursor will accelerate.</p>
|
|
<h3 id="page_section_10"><code>MOUSEKEY_WHEEL_MAX_SPEED</code></h3>
|
|
<p>The top speed for scrolling movements.</p>
|
|
<h3 id="page_section_11"><code>MOUSEKEY_WHEEL_TIME_TO_MAX</code></h3>
|
|
<p>How long you want to hold down a scroll key for until <code>MOUSEKEY_WHEEL_MAX_SPEED</code> is reached. This controls how quickly your scrolling will accelerate.</p>
|
|
</div>
|
|
|
|
<nav>
|
|
<ul class="Pager">
|
|
<li class=Pager--prev><a href="../Features/Macros.html">Previous</a></li> <li class=Pager--next><a href="../Features/Pointing_Device.html">Next</a></li> </ul>
|
|
</nav>
|
|
</article>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- JS -->
|
|
<script src="../themes/daux/js/jquery-1.11.3.min.js"></script><script src="../themes/daux/js/highlight.pack.js"></script><script src="../themes/daux/js/daux.js"></script>
|
|
<!-- Tipue Search -->
|
|
<script type="text/javascript" src="../tipuesearch/tipuesearch.js"></script>
|
|
|
|
<script>
|
|
window.onunload = function(){}; // force $(document).ready to be called on back/forward navigation in firefox
|
|
$(function() {
|
|
tipuesearch({
|
|
'base_url': '../'
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|