{"title":"","byline":null,"dir":null,"lang":null,"content":"<div id=\"readability-page-1\" class=\"page\"><div data-hpc=\"true\"><article><p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">ch57x-keyboard-tool Macro Keyboard Configuration Utility</h2><a href=\"#ch57x-keyboard-tool-macro-keyboard-configuration-utility\" aria-label=\"Permalink: ch57x-keyboard-tool Macro Keyboard Configuration Utility\" id=\"user-content-ch57x-keyboard-tool-macro-keyboard-configuration-utility\"></a></p>\n<p dir=\"auto\"><a href=\"https://camo.githubusercontent.com/ac955d7411192c2f042fb7b22967431c84fcca3d0d7decada7ac3b333decd5b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6b72696f6d616e742f63683537782d6b6579626f6172642d746f6f6c3f7374796c653d666f722d7468652d6261646765\" rel=\"noopener noreferrer nofollow\"><img data-canonical-src=\"https://img.shields.io/github/last-commit/kriomant/ch57x-keyboard-tool?style=for-the-badge\" alt=\"Last Commit Shields.io\" src=\"https://camo.githubusercontent.com/ac955d7411192c2f042fb7b22967431c84fcca3d0d7decada7ac3b333decd5b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6b72696f6d616e742f63683537782d6b6579626f6172642d746f6f6c3f7374796c653d666f722d7468652d6261646765\"></a> <a href=\"https://github.com/kriomant/ch57x-keyboard-tool/actions/workflows/release.yml/badge.svg\" rel=\"noopener noreferrer\"><img alt=\"Release Workflow Badge\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/actions/workflows/release.yml/badge.svg\"></a></p>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">Table of Contents </h2><a href=\"#table-of-contents-\" aria-label=\"Permalink: Table of Contents\" id=\"user-content-table-of-contents-\"></a></p>\n<ul dir=\"auto\">\n<li><a href=\"#what-is-this\">What is this?</a>\n<ul dir=\"auto\">\n<li><a href=\"#supported-keyboards\">Supported keyboards</a></li>\n</ul>\n</li>\n<li><a href=\"#installation\">Installation</a>\n<ul dir=\"auto\">\n<li><a href=\"#prebuilt-release\">Prebuilt release</a></li>\n<li><a href=\"#build-it-yourself\">Build it yourself</a></li>\n</ul>\n</li>\n<li><a href=\"#usage\">Usage</a>\n<ul dir=\"auto\">\n<li><a href=\"#commands-and-options\">Commands and options</a></li>\n<li><a href=\"#validate-the-config-file\">Validate the config file</a></li>\n<li><a href=\"#upload-the-config-to-the-keyboard\">Upload the config to the keyboard</a></li>\n<li><a href=\"#change-led-configuration\">Change LED configuration</a></li>\n<li><a href=\"#windows--powershell\">Windows / PowerShell</a></li>\n</ul>\n</li>\n<li><a href=\"#faq\">FAQ</a>\n<ul dir=\"auto\">\n<li><a href=\"#how-to-do--on-key-press\">How to do … on key press?</a></li>\n<li><a href=\"#can-you-implement--feature\">Can you implement … feature?</a></li>\n</ul>\n</li>\n<li><a href=\"#notes\">Notes</a>\n<ul dir=\"auto\">\n<li><a href=\"#number-of-layers\">Number of layers</a></li>\n<li><a href=\"#custom-keyboard-layouts\">Custom keyboard layouts</a></li>\n<li><a href=\"#3x1-keys--1-knob-keyboard-limitations\">3x1 keys + 1 knob keyboard limitations</a></li>\n<li><a href=\"#macos-vs-windows-keyboard-keys\">macOS vs Windows keyboard keys</a></li>\n</ul>\n</li>\n<li><a href=\"#diagnostics\">Diagnostics</a>\n<ul dir=\"auto\">\n<li><a href=\"#how-to-find-and-list-connected-usb-devices\">How to find and list connected USB devices</a>\n<ul dir=\"auto\">\n<li><a href=\"#macos\">macOS</a></li>\n<li><a href=\"#linux\">Linux</a></li>\n<li><a href=\"#windows\">Windows</a></li>\n</ul>\n</li>\n<li><a href=\"#monitoring-generated-keyboard-and-mouse-events\">Monitoring generated keyboard and mouse events</a></li>\n</ul>\n</li>\n<li><a href=\"#supported-macro-keyboards\">Supported macro keyboards</a>\n<ul dir=\"auto\">\n<li><a href=\"#photos-of-supported-keyboards\">Photos of supported keyboards</a></li>\n</ul>\n</li>\n</ul>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">What is this?</h2><a href=\"#what-is-this\" aria-label=\"Permalink: What is this?\" id=\"user-content-what-is-this\"></a></p>\n<p dir=\"auto\">This keyboard configuration utility is for programming small keyboards, such as the one shown below:</p>\n<p dir=\"auto\"><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-12-2.png\" rel=\"noopener noreferrer\"><img alt=\"Picture of keyboard-12-2\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-12-2.png\"></a></p>\n<p dir=\"auto\">Such macro keyboards are popular on AliExpress, and sellers often include software for programming, but:</p>\n<ul dir=\"auto\">\n<li>It requires Windows</li>\n<li>It is very ugly and inconvenient</li>\n<li>It can only program one key at a time</li>\n<li>It does not expose all keyboard features</li>\n</ul>\n<p dir=\"auto\">There are several modifications of such keyboards with different numbers of buttons and knobs (see the <a href=\"#photos-of-supported-keyboards\">photos of supported keyboards</a>) and with/without Bluetooth.</p>\n<p dir=\"auto\">Both wired and wireless keyboards are supported.\n⚠️ However, the keyboard must be connected to the computer with a USB cable when programming.</p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Supported keyboards</h3><a href=\"#supported-keyboards\" aria-label=\"Permalink: Supported keyboards\" id=\"user-content-supported-keyboards\"></a></p>\n<p dir=\"auto\">This utility has been reported to work with:</p>\n<ul dir=\"auto\">\n<li>3×4 with 2 knobs (Bluetooth version)</li>\n<li>3×3 with 2 knobs</li>\n<li>3x2 with 1 knob</li>\n<li>3x1 with 1 knob with <a href=\"#3x1-keys--1-knob-keyboard-limitations\">limitations</a></li>\n<li>4x1 without knobs</li>\n</ul>\n<p dir=\"auto\">Keyboard with following vendor/product IDs are supported: <code>1189:8890</code>, <code>1189:8840</code>, <code>1189:8842</code> (hexadecimal).</p>\n<p dir=\"auto\">For more details, refer to the <a href=\"#supported-macro-keyboards\">Supported Macro Keyboards</a> section.</p>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">Installation</h2><a href=\"#installation\" aria-label=\"Permalink: Installation\" id=\"user-content-installation\"></a></p>\n<p dir=\"auto\">There are two ways to download the keyboard utility: getting a prebuilt release or building it yourself.</p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Prebuilt release</h3><a href=\"#prebuilt-release\" aria-label=\"Permalink: Prebuilt release\" id=\"user-content-prebuilt-release\"></a></p>\n<p dir=\"auto\">Simply download the <a href=\"https://github.com/kriomant/ch57x-keyboard-tool/releases\">latest release from GitHub</a>.</p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Or build it yourself</h3><a href=\"#or-build-it-yourself\" aria-label=\"Permalink: Or build it yourself\" id=\"user-content-or-build-it-yourself\"></a></p>\n<ol dir=\"auto\">\n<li>Install the <em>cargo</em> utility using <a rel=\"nofollow\" href=\"https://rustup.rs/\">rustup</a>:\n<ul dir=\"auto\">\n<li>Brew: <code>brew install rustup-init &amp;&amp; rustup-init</code></li>\n<li>Linux: <code>curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh</code></li>\n<li>Windows: Download and run <a rel=\"nofollow\" href=\"https://win.rustup.rs/\">rustup-init.exe</a></li>\n</ul>\n</li>\n<li>Execute <code>cargo install ch57x-keyboard-tool</code>.</li>\n</ol>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">If you are on Windows</h3><a href=\"#if-you-are-on-windows\" aria-label=\"Permalink: If you are on Windows\" id=\"user-content-if-you-are-on-windows\"></a></p>\n<p dir=\"auto\">Install <a href=\"https://github.com/daynix/UsbDk/releases\">USBDK</a>.</p>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">Usage</h2><a href=\"#usage\" aria-label=\"Permalink: Usage\" id=\"user-content-usage\"></a></p>\n<ol dir=\"auto\">\n<li>Connect the keyboard to the computer with a USB cable.</li>\n<li>Study <a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/actions.md\">available actions</a>.</li>\n<li>Create a configuration file based on the provided <a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/example-mapping.yaml\">example-mapping.yaml</a>.</li>\n<li>Validate the configuration file.</li>\n<li>Upload the configuration to the keyboard.</li>\n<li>Done! 🎉</li>\n</ol>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Create configuration file</h3><a href=\"#create-configuration-file\" aria-label=\"Permalink: Create configuration file\" id=\"user-content-create-configuration-file\"></a></p>\n<p dir=\"auto\">Edit existing <code>example-mapping.yaml</code> or (better) save modified copy under different name.</p>\n<p dir=\"auto\">Example config file has extensive documentation inside.</p>\n<p dir=\"auto\">You may also get list of supported key names using:</p>\n<div dir=\"auto\"><pre>./ch57x-keyboard-tool show-keys</pre></div>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Validate the config file</h3><a href=\"#validate-the-config-file\" aria-label=\"Permalink: Validate the config file\" id=\"user-content-validate-the-config-file\"></a></p>\n<div dir=\"auto\"><pre>./ch57x-keyboard-tool validate your-config.yaml</pre></div>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Upload the config to the keyboard</h3><a href=\"#upload-the-config-to-the-keyboard\" aria-label=\"Permalink: Upload the config to the keyboard\" id=\"user-content-upload-the-config-to-the-keyboard\"></a></p>\n<div dir=\"auto\"><pre>./ch57x-keyboard-tool upload your-config.yaml</pre></div>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Permissions on Linux</h3><a href=\"#permissions-on-linux\" aria-label=\"Permalink: Permissions on Linux\" id=\"user-content-permissions-on-linux\"></a></p>\n<p dir=\"auto\">Use 'sudo' if you get 'Access denied (insufficient permissions)':</p>\n<div dir=\"auto\"><pre>sudo ./ch57x-keyboard-tool upload your-config.yaml</pre></div>\n<p dir=\"auto\">Alternatively, you may configure <em>udev</em> to give all users permission to program keyboard:</p>\n<p dir=\"auto\">Create file <em>/etc/udev/rules.d/50-usb-macrokeyboard.rules</em> with content:</p>\n<div><pre><code>SUBSYSTEM==\"usb\", ATTR{idVendor}==\"1189\", ATTR{idProduct}==\"8890\", TAG+=\"uaccess\"\n</code></pre></div>\n<p dir=\"auto\">Reload udev configuration</p>\n<div dir=\"auto\"><pre>sudo udevadm control --reload\nsudo udevadm trigger</pre></div>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Change LED configuration</h3><a href=\"#change-led-configuration\" aria-label=\"Permalink: Change LED configuration\" id=\"user-content-change-led-configuration\"></a></p>\n<p dir=\"auto\">If your keyboard supports it, you can change the LED configuration.</p>\n<p dir=\"auto\"><strong>Note:</strong> LED command arguments are model-specific. Different keyboard models have different LED capabilities.</p>\n<p dir=\"auto\"><h4 dir=\"auto\" tabindex=\"-1\">0x8840 and 0x8842</h4><a href=\"#0x8840-and-0x8842\" aria-label=\"Permalink: 0x8840 and 0x8842\" id=\"user-content-0x8840-and-0x8842\"></a></p>\n<p dir=\"auto\">Syntax: <code>./ch57x-keyboard-tool led &lt;layer&gt; &lt;mode&gt;...</code></p>\n<p dir=\"auto\">Modes:</p>\n<ul dir=\"auto\">\n<li><em>off</em> - LEDs off</li>\n<li><em>backlight </em> - backlight always on with color</li>\n<li><em>shock </em> - no backlight, shock effect with color when key pressed</li>\n<li><em>shock2 </em> - no backlight, shock2 effect with color when key pressed</li>\n<li><em>press </em> - no backlight, light up key with color when pressed</li>\n</ul>\n<p dir=\"auto\">Supported key colors: <em>red</em>, <em>orange</em>, <em>yellow</em>, <em>green</em>, <em>cyan</em>, <em>blue</em>, <em>purple</em>.\nBacklight additionally supports <em>white</em>.</p>\n<p dir=\"auto\"><h4 dir=\"auto\" tabindex=\"-1\">0x8890</h4><a href=\"#0x8890\" aria-label=\"Permalink: 0x8890\" id=\"user-content-0x8890\"></a></p>\n<p dir=\"auto\">Set the LED to the first mode (likely \"Steady on\")</p>\n<div dir=\"auto\"><pre>./ch57x-keyboard-tool led 1</pre></div>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">FAQ</h2><a href=\"#faq\" aria-label=\"Permalink: FAQ\" id=\"user-content-faq\"></a></p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">How to do ... on key press?</h3><a href=\"#how-to-do--on-key-press\" aria-label=\"Permalink: How to do ... on key press?\" id=\"user-content-how-to-do--on-key-press\"></a></p>\n<p dir=\"auto\">A common question/request is about automation, such as \"How to run a script?\", \"emulate several keys\", or \"how to trigger an action with a key press?\"</p>\n<p dir=\"auto\">This tool does just one job: <strong>writes your key bindings into the keyboard</strong> and then exits.\nIt does not listen for key presses.\nAutomation based on key presses is not within the scope of this utility tool.</p>\n<p dir=\"auto\">If you seek any automation, use third-party automation tools like <a rel=\"nofollow\" href=\"https://folivora.ai/\">BetterTouchTool</a>.</p>\n<ol dir=\"auto\">\n<li>Choose a chord you do not usually use (like <code>alt-ctrl-shift-1</code>).</li>\n<li>Assign the chord to a key.</li>\n<li>Use a third-party automation tool to listen for this chord and have it perform the desired action.</li>\n<li>Done! 🎉</li>\n</ol>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Can you implement ... feature?</h3><a href=\"#can-you-implement--feature\" aria-label=\"Permalink: Can you implement ... feature?\" id=\"user-content-can-you-implement--feature\"></a></p>\n<p dir=\"auto\">I don't have detailed datasheet for these keyboards. So I can say whether something can implemented until you show me any software that can do it. Then it is teoretically possible to replicate behavior.</p>\n<p dir=\"auto\">However, doing it requires either exact keyboard model in my hands or you to performa reverse engeneering.</p>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">Notes</h2><a href=\"#notes\" aria-label=\"Permalink: Notes\" id=\"user-content-notes\"></a></p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Number of layers</h3><a href=\"#number-of-layers\" aria-label=\"Permalink: Number of layers\" id=\"user-content-number-of-layers\"></a></p>\n<p dir=\"auto\">All keyboards I have seen have three layers (three key configurations which may be switched).\nHowever, if your keyboard does not support layer switching, just keep a single layer in the configuration file.</p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Custom keyboard layouts</h3><a href=\"#custom-keyboard-layouts\" aria-label=\"Permalink: Custom keyboard layouts\" id=\"user-content-custom-keyboard-layouts\"></a></p>\n<p dir=\"auto\">Note that you specify key to emulate press for, not character which is produced by pressing it.\nSo if you use a custom keyboard layout, like <a rel=\"nofollow\" href=\"https://en.wikipedia.org/wiki/Dvorak_keyboard_layout\">Dvorak</a>, you have to see how required key is labelled in QWERTY layout.</p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">3x1 keys + 1 knob keyboard limitations</h3><a href=\"#3x1-keys--1-knob-keyboard-limitations\" aria-label=\"Permalink: 3x1 keys + 1 knob keyboard limitations\" id=\"user-content-3x1-keys--1-knob-keyboard-limitations\"></a></p>\n<p dir=\"auto\">This modification does support key modifiers (like <code>ctrl-</code>, <code>alt-</code>, and <code>cmd-</code>) for the first key in sequence only.</p>\n<p dir=\"auto\">So, you can use: <code>ctrl-alt-del,1,2</code>, but not <code>ctrl-alt-del,alt-1,2</code>.</p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">macOS vs Windows keyboard keys</h3><a href=\"#macos-vs-windows-keyboard-keys\" aria-label=\"Permalink: macOS vs Windows keyboard keys\" id=\"user-content-macos-vs-windows-keyboard-keys\"></a></p>\n<p dir=\"auto\">A friendly reminder that some keys have different names on macOS and Windows.\nThese keys have aliases for both platforms, you may use them interchangeably.</p>\n<table>\n<thead>\n<tr>\n<th>Key Name</th>\n<th>macOS Key</th>\n<th>Windows Key</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Command / Windows</td>\n<td><code>cmd</code></td>\n<td><code>win</code></td>\n</tr>\n<tr>\n<td>Option / Alt</td>\n<td><code>opt</code></td>\n<td><code>alt</code></td>\n</tr>\n</tbody>\n</table>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Commands and options</h3><a href=\"#commands-and-options\" aria-label=\"Permalink: Commands and options\" id=\"user-content-commands-and-options\"></a></p>\n<div dir=\"auto\"><pre>ch57x-keyboard-tool [OPTIONS] <span>&lt;</span>COMMAND<span>&gt;</span></pre></div>\n<p dir=\"auto\">Commands and their descriptions:</p>\n<table>\n<thead>\n<tr>\n<th>Command</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>show-keys</code></td>\n<td>Display a list of all supported keys and modifiers</td>\n</tr>\n<tr>\n<td><code>validate</code></td>\n<td>Validate key mappings config from stdin</td>\n</tr>\n<tr>\n<td><code>upload</code></td>\n<td>Upload key mappings from stdin to the device</td>\n</tr>\n<tr>\n<td><code>led</code></td>\n<td>Configure LED backlight (model-specific arguments)</td>\n</tr>\n<tr>\n<td><code>help</code>, <code>-h</code>, <code>--help</code></td>\n<td>Print this message or the help of the given subcommand(s)</td>\n</tr>\n</tbody>\n</table>\n<p dir=\"auto\">Advanced options, you don't have to use this normally:</p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Description</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>--vendor-id &lt;VENDOR_ID&gt;</code></td>\n<td>Vendor ID of the keyboard</td>\n<td>Default: <code>4489</code></td>\n</tr>\n<tr>\n<td><code>--product-id &lt;PRODUCT_ID&gt;</code></td>\n<td>Product ID of the keyboard</td>\n<td>Default: <code>34960</code></td>\n</tr>\n<tr>\n<td><code>--address &lt;ADDRESS&gt;</code></td>\n<td>Address of the keyboard</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<p dir=\"auto\"><strong>⚠️ The ability to override the vendor/product ID does not mean that you can use this utility to program arbitrary keyboards!</strong></p>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">Diagnostics</h2><a href=\"#diagnostics\" aria-label=\"Permalink: Diagnostics\" id=\"user-content-diagnostics\"></a></p>\n<p dir=\"auto\">When reporting an issue, please include diagnostics such as the list of attached USB devices and the output of the <code>keyboard</code> and <code>mouse</code> monitoring tools.</p>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">How to find and list connected USB devices</h3><a href=\"#how-to-find-and-list-connected-usb-devices\" aria-label=\"Permalink: How to find and list connected USB devices\" id=\"user-content-how-to-find-and-list-connected-usb-devices\"></a></p>\n<p dir=\"auto\"><h4 dir=\"auto\" tabindex=\"-1\">macOS</h4><a href=\"#macos\" aria-label=\"Permalink: macOS\" id=\"user-content-macos\"></a></p>\n<div dir=\"auto\"><pre>system_profiler SPUSBDataType</pre></div>\n<p dir=\"auto\">or</p>\n\n<p dir=\"auto\"><h4 dir=\"auto\" tabindex=\"-1\">Linux</h4><a href=\"#linux\" aria-label=\"Permalink: Linux\" id=\"user-content-linux\"></a></p>\n\n<p dir=\"auto\"><h4 dir=\"auto\" tabindex=\"-1\">Windows</h4><a href=\"#windows\" aria-label=\"Permalink: Windows\" id=\"user-content-windows\"></a></p>\n<div dir=\"auto\"><pre><span>Get-PnpDevice</span> <span>|</span> <span>Where-Object</span> { <span>$_<span>.Class</span></span> <span>-eq</span> <span><span>'</span>USB<span>'</span></span> } <span>|</span> <span>Format-Table</span> Name<span>,</span> DeviceID<span>,</span> Manufacturer<span>,</span> Status<span>,</span> Description <span>-</span>AutoSize</pre></div>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Monitoring generated keyboard and mouse events</h3><a href=\"#monitoring-generated-keyboard-and-mouse-events\" aria-label=\"Permalink: Monitoring generated keyboard and mouse events\" id=\"user-content-monitoring-generated-keyboard-and-mouse-events\"></a></p>\n<p dir=\"auto\">The simplest and cross-platform way to monitor keyboard and mouse events is using the <code>keyboard</code> and <code>mouse</code> Python modules.</p>\n<p dir=\"auto\">Monitoring keyboard:</p>\n<div dir=\"auto\"><pre>pip3 install keyboard\nsudo python3 -m keyboard</pre></div>\n<p dir=\"auto\">Monitoring mouse:</p>\n<ul dir=\"auto\">\n<li>The latest published 'mouse' module doesn't support macOS, so use the latest version from GitHub</li>\n</ul>\n<div dir=\"auto\"><pre>git clone https://github.com/boppreh/mouse\n<span>cd</span> mouse\npython3 -m mouse</pre></div>\n<p dir=\"auto\"><h2 dir=\"auto\" tabindex=\"-1\">Supported macro keyboards</h2><a href=\"#supported-macro-keyboards\" aria-label=\"Permalink: Supported macro keyboards\" id=\"user-content-supported-macro-keyboards\"></a></p>\n<ul dir=\"auto\">\n<li>Product ID: 0x8890, 0x8840\n<ul dir=\"auto\">\n<li>Vendor ID: 0x1189  (Trisat Industrial Co., Ltd.)</li>\n<li><a rel=\"nofollow\" href=\"https://www.amazon.co.jp/dp/B0CF5L8HP3\">amazon.co.jp/dp/B0CF5L8HP3</a></li>\n</ul>\n</li>\n</ul>\n<p dir=\"auto\"><h3 dir=\"auto\" tabindex=\"-1\">Photos of supported keyboards</h3><a href=\"#photos-of-supported-keyboards\" aria-label=\"Permalink: Photos of supported keyboards\" id=\"user-content-photos-of-supported-keyboards\"></a></p>\n<table>\n<thead>\n<tr>\n<th>Kind</th>\n<th>Photo</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>3x2 with 1 knob</td>\n<td><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-6-1.png\" rel=\"noopener noreferrer\"><img alt=\"keyboard-6-1\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-6-1.png\"></a></td>\n</tr>\n<tr>\n<td>3x2 with 1 knob</td>\n<td><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-6-1a.png\" rel=\"noopener noreferrer\"><img alt=\"keyboard-6-1\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-6-1a.png\"></a></td>\n</tr>\n<tr>\n<td>3x1 with 1 knob</td>\n<td><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-3-1.jpg\" rel=\"noopener noreferrer\"><img alt=\"keyboard-3-1\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-3-1.jpg\"></a></td>\n</tr>\n<tr>\n<td>3×3 with 2 knobs</td>\n<td><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-12-2.png\" rel=\"noopener noreferrer\"><img alt=\"keyboard-12-2\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-12-2.png\"></a></td>\n</tr>\n<tr>\n<td>4x3 with 3 knobs</td>\n<td><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-4-3.png\" rel=\"noopener noreferrer\"><img alt=\"keyboard-4-3\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-4-3.png\"></a></td>\n</tr>\n<tr>\n<td>4×1 without knobs</td>\n<td><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-4-1.png\" rel=\"noopener noreferrer\"><img alt=\"keyboard-4-1\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-4-1.png\"></a></td>\n</tr>\n<tr>\n<td>5×3 with 3 knobs</td>\n<td><a href=\"https://github.com/kriomant/ch57x-keyboard-tool/blob/master/doc/keyboard-15-3.png\" rel=\"noopener noreferrer\"><img alt=\"keyboard-15-3\" src=\"https://github.com/kriomant/ch57x-keyboard-tool/raw/master/doc/keyboard-15-3.png\"></a></td>\n</tr>\n</tbody>\n</table>\n</article></div></div>","textContent":"ch57x-keyboard-tool Macro Keyboard Configuration Utility\n \nTable of Contents \n\nWhat is this?\n\nSupported keyboards\n\n\nInstallation\n\nPrebuilt release\nBuild it yourself\n\n\nUsage\n\nCommands and options\nValidate the config file\nUpload the config to the keyboard\nChange LED configuration\nWindows / PowerShell\n\n\nFAQ\n\nHow to do … on key press?\nCan you implement … feature?\n\n\nNotes\n\nNumber of layers\nCustom keyboard layouts\n3x1 keys + 1 knob keyboard limitations\nmacOS vs Windows keyboard keys\n\n\nDiagnostics\n\nHow to find and list connected USB devices\n\nmacOS\nLinux\nWindows\n\n\nMonitoring generated keyboard and mouse events\n\n\nSupported macro keyboards\n\nPhotos of supported keyboards\n\n\n\nWhat is this?\nThis keyboard configuration utility is for programming small keyboards, such as the one shown below:\n\nSuch macro keyboards are popular on AliExpress, and sellers often include software for programming, but:\n\nIt requires Windows\nIt is very ugly and inconvenient\nIt can only program one key at a time\nIt does not expose all keyboard features\n\nThere are several modifications of such keyboards with different numbers of buttons and knobs (see the photos of supported keyboards) and with/without Bluetooth.\nBoth wired and wireless keyboards are supported.\n⚠️ However, the keyboard must be connected to the computer with a USB cable when programming.\nSupported keyboards\nThis utility has been reported to work with:\n\n3×4 with 2 knobs (Bluetooth version)\n3×3 with 2 knobs\n3x2 with 1 knob\n3x1 with 1 knob with limitations\n4x1 without knobs\n\nKeyboard with following vendor/product IDs are supported: 1189:8890, 1189:8840, 1189:8842 (hexadecimal).\nFor more details, refer to the Supported Macro Keyboards section.\nInstallation\nThere are two ways to download the keyboard utility: getting a prebuilt release or building it yourself.\nPrebuilt release\nSimply download the latest release from GitHub.\nOr build it yourself\n\nInstall the cargo utility using rustup:\n\nBrew: brew install rustup-init && rustup-init\nLinux: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nWindows: Download and run rustup-init.exe\n\n\nExecute cargo install ch57x-keyboard-tool.\n\nIf you are on Windows\nInstall USBDK.\nUsage\n\nConnect the keyboard to the computer with a USB cable.\nStudy available actions.\nCreate a configuration file based on the provided example-mapping.yaml.\nValidate the configuration file.\nUpload the configuration to the keyboard.\nDone! 🎉\n\nCreate configuration file\nEdit existing example-mapping.yaml or (better) save modified copy under different name.\nExample config file has extensive documentation inside.\nYou may also get list of supported key names using:\n./ch57x-keyboard-tool show-keys\nValidate the config file\n./ch57x-keyboard-tool validate your-config.yaml\nUpload the config to the keyboard\n./ch57x-keyboard-tool upload your-config.yaml\nPermissions on Linux\nUse 'sudo' if you get 'Access denied (insufficient permissions)':\nsudo ./ch57x-keyboard-tool upload your-config.yaml\nAlternatively, you may configure udev to give all users permission to program keyboard:\nCreate file /etc/udev/rules.d/50-usb-macrokeyboard.rules with content:\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"1189\", ATTR{idProduct}==\"8890\", TAG+=\"uaccess\"\n\nReload udev configuration\nsudo udevadm control --reload\nsudo udevadm trigger\nChange LED configuration\nIf your keyboard supports it, you can change the LED configuration.\nNote: LED command arguments are model-specific. Different keyboard models have different LED capabilities.\n0x8840 and 0x8842\nSyntax: ./ch57x-keyboard-tool led <layer> <mode>...\nModes:\n\noff - LEDs off\nbacklight  - backlight always on with color\nshock  - no backlight, shock effect with color when key pressed\nshock2  - no backlight, shock2 effect with color when key pressed\npress  - no backlight, light up key with color when pressed\n\nSupported key colors: red, orange, yellow, green, cyan, blue, purple.\nBacklight additionally supports white.\n0x8890\nSet the LED to the first mode (likely \"Steady on\")\n./ch57x-keyboard-tool led 1\nFAQ\nHow to do ... on key press?\nA common question/request is about automation, such as \"How to run a script?\", \"emulate several keys\", or \"how to trigger an action with a key press?\"\nThis tool does just one job: writes your key bindings into the keyboard and then exits.\nIt does not listen for key presses.\nAutomation based on key presses is not within the scope of this utility tool.\nIf you seek any automation, use third-party automation tools like BetterTouchTool.\n\nChoose a chord you do not usually use (like alt-ctrl-shift-1).\nAssign the chord to a key.\nUse a third-party automation tool to listen for this chord and have it perform the desired action.\nDone! 🎉\n\nCan you implement ... feature?\nI don't have detailed datasheet for these keyboards. So I can say whether something can implemented until you show me any software that can do it. Then it is teoretically possible to replicate behavior.\nHowever, doing it requires either exact keyboard model in my hands or you to performa reverse engeneering.\nNotes\nNumber of layers\nAll keyboards I have seen have three layers (three key configurations which may be switched).\nHowever, if your keyboard does not support layer switching, just keep a single layer in the configuration file.\nCustom keyboard layouts\nNote that you specify key to emulate press for, not character which is produced by pressing it.\nSo if you use a custom keyboard layout, like Dvorak, you have to see how required key is labelled in QWERTY layout.\n3x1 keys + 1 knob keyboard limitations\nThis modification does support key modifiers (like ctrl-, alt-, and cmd-) for the first key in sequence only.\nSo, you can use: ctrl-alt-del,1,2, but not ctrl-alt-del,alt-1,2.\nmacOS vs Windows keyboard keys\nA friendly reminder that some keys have different names on macOS and Windows.\nThese keys have aliases for both platforms, you may use them interchangeably.\n\n\n\nKey Name\nmacOS Key\nWindows Key\n\n\n\n\nCommand / Windows\ncmd\nwin\n\n\nOption / Alt\nopt\nalt\n\n\n\nCommands and options\nch57x-keyboard-tool [OPTIONS] <COMMAND>\nCommands and their descriptions:\n\n\n\nCommand\nDescription\n\n\n\n\nshow-keys\nDisplay a list of all supported keys and modifiers\n\n\nvalidate\nValidate key mappings config from stdin\n\n\nupload\nUpload key mappings from stdin to the device\n\n\nled\nConfigure LED backlight (model-specific arguments)\n\n\nhelp, -h, --help\nPrint this message or the help of the given subcommand(s)\n\n\n\nAdvanced options, you don't have to use this normally:\n\n\n\nOption\nDescription\nNotes\n\n\n\n\n--vendor-id <VENDOR_ID>\nVendor ID of the keyboard\nDefault: 4489\n\n\n--product-id <PRODUCT_ID>\nProduct ID of the keyboard\nDefault: 34960\n\n\n--address <ADDRESS>\nAddress of the keyboard\n\n\n\n\n⚠️ The ability to override the vendor/product ID does not mean that you can use this utility to program arbitrary keyboards!\nDiagnostics\nWhen reporting an issue, please include diagnostics such as the list of attached USB devices and the output of the keyboard and mouse monitoring tools.\nHow to find and list connected USB devices\nmacOS\nsystem_profiler SPUSBDataType\nor\n\nLinux\n\nWindows\nGet-PnpDevice | Where-Object { $_.Class -eq 'USB' } | Format-Table Name, DeviceID, Manufacturer, Status, Description -AutoSize\nMonitoring generated keyboard and mouse events\nThe simplest and cross-platform way to monitor keyboard and mouse events is using the keyboard and mouse Python modules.\nMonitoring keyboard:\npip3 install keyboard\nsudo python3 -m keyboard\nMonitoring mouse:\n\nThe latest published 'mouse' module doesn't support macOS, so use the latest version from GitHub\n\ngit clone https://github.com/boppreh/mouse\ncd mouse\npython3 -m mouse\nSupported macro keyboards\n\nProduct ID: 0x8890, 0x8840\n\nVendor ID: 0x1189  (Trisat Industrial Co., Ltd.)\namazon.co.jp/dp/B0CF5L8HP3\n\n\n\nPhotos of supported keyboards\n\n\n\nKind\nPhoto\n\n\n\n\n3x2 with 1 knob\n\n\n\n3x2 with 1 knob\n\n\n\n3x1 with 1 knob\n\n\n\n3×3 with 2 knobs\n\n\n\n4x3 with 3 knobs\n\n\n\n4×1 without knobs\n\n\n\n5×3 with 3 knobs\n\n\n\n\n","length":7926,"excerpt":"ch57x-keyboard-tool Macro Keyboard Configuration Utility","siteName":null}