/fusuma-plugin-thumbsense

Remapper from key to click only while tapping the touchpad. Implemented as Fusuma Plugin.

Primary LanguageRubyMIT LicenseMIT

Fusuma::Plugin::Thumbsense Gem Version Build Status

Remapper from key to click only while tapping the touchpad.
Implemented as Fusuma Plugin.

What is ThumbSense?

ThumbSense is a tool that lets you control a laptop's touchpad using the keyboard. It assigns certain keyboard keys as mouse buttons and switches between acting as mouse buttons or normal keyboard keys based on whether the user's thumb is touching the touchpad. ThumbSense aims to make it easier to use the touchpad without moving your hand away from the keyboard.

Installation

Prerequisites

Steps to Install and Set Up Fusuma::Plugin::Thumbsense

  1. Install the necessary packages for native extensions:
$ sudo apt install ruby-dev build-essential
  1. Install the required library for building fusuma-plugin-remap:
$ sudo apt install libevdev-dev
  1. Set up udev rules to create a virtual input device (for fusuma-plugin-remap):
$ echo 'KERNEL=="uinput", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"' | sudo tee /etc/udev/rules.d/60-udev-fusuma-remap.rules
$ sudo udevadm control --reload-rules && sudo udevadm trigger
  1. Install fusuma-plugin-thumbsense:
$ sudo gem install fusuma-plugin-thumbsense

Configuration

Thumbsense Context

To add the thumbsense context, edit ~/.config/fusuma/config.yml. The context section is separated by --- and specified as context: thumbsense. Fusuma will switch to the thumbsense context while tapping the touchpad.

Key to Mouse Button Remap

You can remap keys to mouse buttons while tapping the touchpad. The remap property is configured within the thumbsense context.

Available mouse buttons include:

  • BTN_LEFT
  • BTN_MIDDLE
  • BTN_RIGHT
  • BTN_SIDE
  • BTN_EXTRA
  • BTN_FORWARD
  • BTN_BACK
  • BTN_TASK
  • BTN_0
  • BTN_1
  • ...
  • BTN_9

Example Configuration

Add the following code to ~/.config/fusuma/config.yml:

# Add thumbsense context
---
context: thumbsense

remap:
  F: BTN_LEFT
  E: BTN_MIDDLE
  D: BTN_RIGHT
  SPACE: BTN_LEFT
  J: BTN_LEFT
  K: BTN_RIGHT

Pointing Stick Support

Overview

Fusuma::Plugin::Thumbsense provides experimental support for pointing stick devices. This functionality is currently limited to the HHKB Studio and utilizes HIDRAW. Please note that this feature is still in testing, and improvements may be made in future updates.

see: #4

Setting Up Udev Rules

To use the pointing stick touch support, you need to set up the following Udev rules to ensure that the HHKB Studio device is correctly recognized:

  1. Create the Udev Rule File: Create a Udev rule file with the following command:

    sudo nano /etc/udev/rules.d/60-udev-fusuma-thumbsense-hhkb-studio.rules

    Add the following content to the file:

    # HHKB Studio (USB)
    KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="04fe", ATTRS{idProduct}=="0016", MODE="0666"
    
    # HHKB Studio (Bluetooth)
    KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ENV{DEVPATH}=="/devices/virtual/misc/uhid/*:04FE:0016.*/hidraw*", MODE="0666"
    
  2. Reload the Udev Rules: Execute the following command to reload the Udev rules:

    sudo udevadm control --reload-rules && sudo udevadm trigger

TODO LIST

  • ThumbSense

    • Change remap layer while tapping
    • Enable executing commands like command: and sendkey:
    • Support pointing stick devices(#4)
      • Now only HHKB Studio is supported using HIDRAW
  • Remap

    • Remap to single key (e.g., remap: { J: BTN_LEFT })
    • Send mouse clicks with remap: { I: BTN_MIDDLE }
    • Remap multiple keys
    • Remap POINTER_MOTION to POINTER_SCROLL_FINGER (e.g., remap: { S: POINTER_SCROLL_FINGER })

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/iberianpig/fusuma-plugin-thumbsense. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Fusuma::Plugin::Thumbsense project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.