{"id":41223084,"url":"https://github.com/kot149/zmk-mouse-gesture","last_synced_at":"2026-01-23T00:24:57.071Z","repository":{"id":302247016,"uuid":"1010470804","full_name":"kot149/zmk-mouse-gesture","owner":"kot149","description":"A ZMK module that converts combinations of 4-direction mouse strokes into key presses or any other behaviors.","archived":false,"fork":false,"pushed_at":"2025-09-28T15:28:40.000Z","size":93,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"v1","last_synced_at":"2025-09-28T17:22:02.855Z","etag":null,"topics":["zmk","zmk-module"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kot149.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-29T06:19:36.000Z","updated_at":"2025-09-28T17:14:13.000Z","dependencies_parsed_at":"2025-07-25T12:17:38.682Z","dependency_job_id":"c0be5f4c-598c-40f6-8fed-7301744cf425","html_url":"https://github.com/kot149/zmk-mouse-gesture","commit_stats":null,"previous_names":["kot149/zmk-mouse-gesture"],"tags_count":0,"template":false,"template_full_name":"zmkfirmware/zmk-module-template","purl":"pkg:github/kot149/zmk-mouse-gesture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kot149%2Fzmk-mouse-gesture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kot149%2Fzmk-mouse-gesture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kot149%2Fzmk-mouse-gesture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kot149%2Fzmk-mouse-gesture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kot149","download_url":"https://codeload.github.com/kot149/zmk-mouse-gesture/tar.gz/refs/heads/v1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kot149%2Fzmk-mouse-gesture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28675934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T20:48:19.482Z","status":"ssl_error","status_checked_at":"2026-01-22T20:48:14.968Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["zmk","zmk-module"],"created_at":"2026-01-23T00:24:56.974Z","updated_at":"2026-01-23T00:24:57.059Z","avatar_url":"https://github.com/kot149.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZMK Mouse Gesture Module\n\nA ZMK module that converts combinations of 4-direction mouse strokes into key presses or any other behaviors.\n\n## Demo\n\nhttps://github.com/user-attachments/assets/f425d315-659b-4f1e-9d21-6451eb60e168\n\n## Installation\n\nAdd the Module to your `west.yml`.\n\n```yml\nmanifest:\n  remotes:\n    - name: zmkfirmware\n      url-base: https://github.com/zmkfirmware\n    - name: kot149\n      url-base: https://github.com/kot149\n  projects:\n    - name: zmk\n      remote: zmkfirmware\n      revision: main\n      import: app/west.yml\n    - name: zmk-mouse-gesture\n      remote: kot149\n      revision: v1\n  self:\n    path: config\n```\n\n## Usage\n\n### 1. Include `mouse-gesture.dtsi`\n\n```c\n#include \u003cmouse-gesture.dtsi\u003e\n```\n\n### 2. Add activation key\n```dts\n#include \u003cmouse-gesture.dtsi\u003e\n\n/ {\n    keymap {\n        compatible = \"zmk,keymap\";\n\n        default_layer {\n            bindings = \u003c\n                \u0026mouse_gesture // Activates mouse gesture while it is pressed\n                \u0026mouse_gesture_on // Activates mouse gesture on each press\n                \u0026mouse_gesture_off // Deactivates mouse gesture on each press\n                \u0026mouse_gesture_toggle // Toggle mouse gesture on/off on each press\n                \u0026mouse_gesture_kp 0 A // Activates mouse gesture while held, and triggers \u0026kp A on tap\n                \u0026mouse_gesture_mkp 0 RCLK // Activates mouse gesture while held, and triggers right click on tap\n            \u003e;\n        };\n    };\n};\n```\n\n### 3. Configure Input Processor\n\nDefine the gesture patterns in `\u0026zip_mouse_gesture`and add it to the input processor of your pointing device.\n\n```dts\n#include \u003cmouse-gesture.dtsi\u003e\n\n\u0026zip_mouse_gesture {\n    stroke-size = \u003c300\u003e; // Optional (default: 200)\n    enable-eager-mode; // Optional, but recommended\n\n    history_back {\n        pattern = \u003cGESTURE_RIGHT\u003e;\n        bindings = \u003c\u0026kp LA(LEFT)\u003e;\n    };\n\n    history_forward {\n        pattern = \u003cGESTURE_LEFT\u003e;\n        bindings = \u003c\u0026kp LA(RIGHT)\u003e;\n    };\n\n    close_tab {\n        pattern = \u003cGESTURE_DOWN GESTURE_RIGHT\u003e;\n        bindings = \u003c\u0026kp LC(W)\u003e;\n    };\n\n    new_tab {\n        pattern = \u003cGESTURE_DOWN GESTURE_LEFT\u003e;\n        bindings = \u003c\u0026kp LC(T)\u003e;\n    };\n};\n\n\u0026trackball_listener {\n    compatible = \"zmk,input-listener\";\n    device = \u003c\u0026trackball\u003e;\n\n    input-processors = \u003c\u0026zip_mouse_gesture\u003e;\n};\n```\n\n#### Options\n\n- `stroke-size` (default: 200): Size of one stroke in a gesture. Note that larger stroke than this value is fine, as duplicate directions will be ignored.\n- `idle-timeout-ms` (default: 150): Time in milliseconds to wait for idle before invoking the bindings. When set to 0, idle timeout is disabled.\n- `enable-eager-mode` (default: false): Invoke bindings immediately when gesture pattern is matched. Duplicate gesture patterns (cases where a pattern is a subset of another pattern, for example, `\u003cGESTURE_RIGHT\u003e` and `\u003cGESTURE_RIGHT GESTURE_DOWN\u003e`) are resolved by invoking after idle timeout, which will be canceled if longer pattern is detected within the timeout, while non-duplicate gestures are invoked immediately. When disabled, bindings will only be invoked when idle timeout triggers or the activation key is released.\n- `movement-threshold` (default: 10): Threshold for each x/y event.\n- `gesture-cooldown-ms` (default: 500): Time in milliseconds to stop processing for next gesture after the execution of a gesture. This is useful to prevent unexpected double gestures.\n\n### 5. Perform the gesture\n\nActivate gesture by pressing the activation key and perform the gesture.\n\n## Advanced Usage\n\n- **Automatic Activation**: use [zmk-listeners](https://github.com/ssbb/zmk-listeners) to activate the gesture automatically on specific layers, and additionally, use `zip_temp_layer` to automatically activate the layer\n\n- **Activate with existing keys**: create a macro that involves activation keys, or use [zmk-listeners](https://github.com/ssbb/zmk-listeners), to activate the gesture with existing keys\n\n- **Layer-specific gestures**: define [layer-spesific input processors](https://zmk.dev/docs/keymaps/input-processors/usage#layer-specific-overrides) to trigger different gestures on different layers\n\n## Related Works\n\n### zmk-input-processor-keybind (by [te9no](https://github.com/te9no/zmk-input-processor-keybind) and [zettaface](https://github.com/zettaface/zmk-input-processor-keybind))\n\nConverts mouse movement into key presses (e.g., arrow keys).\n\nWhile both keybind and mouse-gesture modules handle mouse move events and trigger behaviors, they serve different purposes:\n\n- **keybind**: Direct, continuous conversion of mouse movement to key presses\n- **mouse-gesture**: Pattern recognition that triggers single-shot behaviors based on the gestures drawn\n\n### [input-processor-behaviors](https://zmk.dev/docs/keymaps/input-processors/behaviors)\n\nOfficial ZMK input processor that converts mouse button presses into behaviors.\nUnlike keybind and mouse-gesture modules, this feature is intended to process mouse button clicks rather than mouse movement; It does not quantize mouse movement or consider its direction.\n\n### [zmk-input-gestures](https://github.com/halfdane/zmk-input-gestures)\n\nProvides trackpad-specific gestures like tap-to-click, inertial cursor, and circular scrolling. This module focuses on trackpad interactions rather than converting general mouse movement to behaviors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkot149%2Fzmk-mouse-gesture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkot149%2Fzmk-mouse-gesture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkot149%2Fzmk-mouse-gesture/lists"}