{"id":16941258,"url":"https://github.com/iberianpig/fusuma-plugin-remap","last_synced_at":"2026-04-16T02:32:34.294Z","repository":{"id":161096863,"uuid":"635860412","full_name":"iberianpig/fusuma-plugin-remap","owner":"iberianpig","description":"A Fusuma plugin for remapping keyboard events into virtual input devices.","archived":false,"fork":false,"pushed_at":"2026-03-19T17:27:31.000Z","size":194,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-20T09:15:01.498Z","etag":null,"topics":["fusuma","keyboard","linux","remap","remapper"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/iberianpig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["iberianpig"]}},"created_at":"2023-05-03T15:54:32.000Z","updated_at":"2026-03-19T17:27:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa45120a-211a-47a0-98dd-a693130a3a08","html_url":"https://github.com/iberianpig/fusuma-plugin-remap","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/iberianpig/fusuma-plugin-remap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iberianpig%2Ffusuma-plugin-remap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iberianpig%2Ffusuma-plugin-remap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iberianpig%2Ffusuma-plugin-remap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iberianpig%2Ffusuma-plugin-remap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iberianpig","download_url":"https://codeload.github.com/iberianpig/fusuma-plugin-remap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iberianpig%2Ffusuma-plugin-remap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31868508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fusuma","keyboard","linux","remap","remapper"],"created_at":"2024-10-13T21:09:05.672Z","updated_at":"2026-04-16T02:32:34.281Z","avatar_url":"https://github.com/iberianpig.png","language":"Ruby","funding_links":["https://github.com/sponsors/iberianpig"],"categories":[],"sub_categories":[],"readme":"# Fusuma::Plugin::Remap [![Gem Version](https://badge.fury.io/rb/fusuma-plugin-remap.svg)](https://badge.fury.io/rb/fusuma-plugin-remap) [![Build Status](https://github.com/iberianpig/fusuma-plugin-remap/actions/workflows/main.yml/badge.svg)](https://github.com/iberianpig/fusuma-plugin-remap/actions/workflows/main.yml)\n\nA Fusuma plugin for remapping keyboard events into virtual input devices. Compatible with other Fusuma plugins.\n\n**THIS PLUGIN IS EXPERIMENTAL.**\n\nThis plugin empowers users to manipulate keyboard events and convert them into virtual input devices. It is designed to integrate seamlessly with other Fusuma plugins, thus enabling users to construct sophisticated input configurations and achieve distinctive functionalities. A key feature is the dynamic alteration of remapping layers within the Fusuma process, thereby enabling users to adapt their keyboard inputs to suit specific tasks or applications.\n\n## Installation\n\nThis plugin requires [fusuma](https://github.com/iberianpig/fusuma#update) 2.0\n\n### Install dependencies\n\n**NOTE: If you have installed ruby by apt, you must install ruby-dev.**\n```sh\n$ sudo apt-get install libevdev-dev ruby-dev build-essential\n```\n\n### Set up udev rules\n\nfusuma-plugin-remap create virtual input device(`fusuma_virtual_keyboard`) by uinput. So you need to set up udev rules.\n\n```sh\n$ echo 'KERNEL==\"uinput\", MODE=\"0660\", GROUP=\"input\", OPTIONS+=\"static_node=uinput\"' | sudo tee /etc/udev/rules.d/60-udev-fusuma-remap.rules\n```\n\nThen, reload udev rules.\n\n```sh\n$ sudo udevadm control --reload-rules \u0026\u0026 sudo udevadm trigger\n```\n\n### Install fusuma-plugin-remap\n\n```sh\n$ sudo gem install fusuma-plugin-remap\n```\n\n## Properties\n\n### Remap\n\nYou can remap keys in `~/.config/fusuma/config.yml`. The `remap` section defines key remappings.\n\n#### Basic Remap\n\nSimple key-to-key remapping without any context:\n\n```yaml\nremap:\n  CAPSLOCK: LEFTCTRL\n  LEFTALT: LEFTMETA\n  LEFTMETA: LEFTALT\n```\n\n#### Key Alias for Modifiers\n\nWhen a simple key remap is defined (e.g., `CAPSLOCK: LEFTCTRL`), the key acts as an **alias** for the target modifier. The modifier state tracks the remapped key, not the physical key.\n\n```yaml\nremap:\n  CAPSLOCK: LEFTCTRL  # CAPSLOCK acts as LEFTCTRL alias\n  LEFTCTRL+LEFTSHIFT+J: LEFTMETA+LEFTCTRL+DOWN  # Combination using the alias\n```\n\nWith this configuration:\n- Physical `CAPSLOCK` is treated as `LEFTCTRL`\n- Physical `CAPSLOCK+LEFTSHIFT+J` triggers `LEFTCTRL+LEFTSHIFT+J` combination\n- This outputs `LEFTMETA+LEFTCTRL+DOWN`\n\n#### Output Sequence\n\nYou can send multiple key combinations in sequence using an array:\n\n```yaml\nremap:\n  LEFTCTRL+U: [LEFTSHIFT+HOME, DELETE]  # Select to line start, then delete\n  LEFTCTRL+K: [LEFTSHIFT+END, DELETE]   # Select to line end, then delete\n```\n\n#### Modifier + Key Combinations\n\nRemap modifier key combinations to other keys or combinations:\n\n```yaml\nremap:\n  LEFTCTRL+J: DOWN\n  LEFTCTRL+K: UP\n  LEFTCTRL+H: LEFT\n  LEFTCTRL+L: RIGHT\n  LEFTALT+N: LEFTCTRL+TAB           # Next tab\n  LEFTALT+P: LEFTCTRL+LEFTSHIFT+TAB # Previous tab\n```\n\n### Context\n\nYou can define different remappings for different contexts. Contexts are separated by `---`.\n\n#### Application Context\n\nRemap keys only for specific applications:\n\n```yaml\n---\ncontext:\n  application: Alacritty\n\nremap:\n  LEFTMETA+N: LEFTCTRL+LEFTSHIFT+T  # New tab in terminal\n  LEFTMETA+W: LEFTCTRL+LEFTSHIFT+W  # Close tab\n```\n\n#### Thumbsense Context\n\nFor thumbsense mode, install [fusuma-plugin-thumbsense](https://github.com/iberianpig/fusuma-plugin-thumbsense):\n\n```yaml\n---\ncontext:\n  thumbsense: true\n\nremap:\n  J: BTN_LEFT\n  K: BTN_RIGHT\n  F: BTN_LEFT\n  D: BTN_RIGHT\n  SPACE: BTN_LEFT\n```\n\n#### Device Context\n\nYou can define different remappings for specific keyboard devices. The `device` pattern uses case-insensitive partial matching against the physical device name.\n\n```yaml\n---\n# HHKB-specific remappings (matches device names containing \"HHKB\")\ncontext:\n  device: HHKB\n\nremap:\n  LEFTCTRL: LEFTMETA  # Swap Ctrl to Meta on HHKB\n\n---\n# Built-in keyboard remappings (matches \"AT Translated Set 2 keyboard\")\ncontext:\n  device: AT Translated\n\nremap:\n  LEFTALT: LEFTCTRL   # Remap Alt to Ctrl on built-in keyboard\n```\n\nTo find your keyboard's device name, run:\n```sh\nlibinput list-devices\n```\n\n#### Combined Contexts\n\nYou can combine multiple context conditions. When multiple contexts are active, mappings are merged with priority order: `device` \u003c `thumbsense` \u003c `application`.\n\n```yaml\n---\n# HHKB + Thumbsense mode\ncontext:\n  device: HHKB\n  thumbsense: true\n\nremap:\n  J: BTN_LEFT\n  K: BTN_RIGHT\n```\n\n### Complete Example\n\n```yaml\n# Default remappings (always active)\nremap:\n  CAPSLOCK: LEFTCTRL\n  LEFTALT: LEFTMETA\n  LEFTMETA: LEFTALT\n  LEFTCTRL+J: DOWN\n  LEFTCTRL+K: UP\n\n---\n# Application-specific remappings\ncontext:\n  application: Alacritty\n\nremap:\n  LEFTMETA+N: LEFTCTRL+LEFTSHIFT+T\n\n---\n# Thumbsense mode\ncontext:\n  thumbsense: true\n\nremap:\n  J: BTN_LEFT\n  K: BTN_RIGHT\n```\n\n## Emergency Stop Keybind for Virtual Keyboard\n\nThis plugin includes a special keybind for emergency stop. Pressing this key combination will ungrab the physical keyboard and terminate the Fusuma process. This feature is particularly useful in situations where the plugin or system becomes unresponsive.\n\n### How to Use\nTo execute the emergency stop, press the following key combination(default):\n- \u003ckbd\u003eRIGHTCTRL\u003c/kbd\u003e → \u003ckbd\u003eLEFTCTRL\u003c/kbd\u003e\n\n### Configuration Example\nYou can configure the emergency stop key in your Fusuma configuration file (`~/.config/fusuma/config.yml`) as follows:\n\n```yaml\nplugin:\n  inputs:\n    remap_keyboard_input:\n      emergency_ungrab_keys: RIGHTCTRL+LEFTCTRL # \u003c- Set two keys separated by '+' to trigger the emergency stop\n```\n\nThis configuration allows you to specify which keys will trigger the emergency stop functionality.\nIt is important to verify this keybind to ensure a swift response during unexpected situations.\n\n### Input Device Detection\n\n#### Keyboard\n\nconfigure `plugin.inputs.remap_keyboard_input` in `~/.config/fusuma/config.yml` to specify which physical keyboard to remap.\n\nIf your external or built-in keyboard is not detected, run `libinput list-devices` to find its name and add a matching pattern under `keyboard_name_patterns`.\n\n```yaml\nplugin:\n  inputs:\n    remap_keyboard_input:\n      # By default, Fusuma will detect physical keyboards matching these patterns.\n      # You can specify multiple regular‐expression strings in an array.\n      keyboard_name_patterns:\n        # Default value\n        - keyboard|Keyboard|KEYBOARD\n\n      # Emergency stop key combination.\n      # Specify exactly two keys joined by '+'.\n      emergency_ungrab_keys: RIGHTCTRL+LEFTCTRL\n```\n\nYou can customize `keyboard_name_patterns` like this:\n\n```yaml\nplugin:\n  inputs:\n    remap_keyboard_input:\n      keyboard_name_patterns:\n        - xremap                     # Virtual keyboard created by another remapper\n        - PFU Limited HHKB-Hybrid    # External keyboard\n        - keyboard|Keyboard|KEYBOARD # Default pattern\n```\n\nIf your keyboard isn’t detected, run:\n\n```sh\nlibinput list-devices\n```\n\nand add a suitable name pattern.\n\n#### Touchpad\n\nTo specify touchpad name, configure `plugin.inputs.remap_touchpad_input`:\n\n```yaml\nplugin:\n  inputs:\n    remap_touchpad_input:\n      # By default, Fusuma will detect physical touchpads matching these patterns.\n      touchpad_name_patterns:\n        # Default values\n        - touchpad|Touchpad|TOUCHPAD\n        - trackpad|Trackpad|TRACKPAD\n```\n\nYou can customize `touchpad_name_patterns` like this:\n\n```yaml\nplugin:\n  inputs:\n    remap_touchpad_input:\n      touchpad_name_patterns:\n        - Apple Inc. Magic Trackpad   # External Trackpad\n        - your touchpad device name   # Any other touchpad\n        - Touchpad|Trackpad           # match to \"Touchpad\" or \"Trackpad\"\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/iberianpig/fusuma-plugin-remap. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Fusuma::Plugin::Remap project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/iberianpig/fusuma-plugin-remap/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiberianpig%2Ffusuma-plugin-remap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiberianpig%2Ffusuma-plugin-remap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiberianpig%2Ffusuma-plugin-remap/lists"}