Remapping HID For Fun And… Well Fun

If you want to remap some mouse or keyboard keys, and you use Linux, it is easy. If you use Windows or another operating system, you can probably do that without too much trouble. But what if you use all of them? Or what if you don’t have access to the computer in question? Thanks to [jfedor2], you can reach for a Raspberry Pi Pico and make this handy key-and-mouse remapping hardware dongle.

But you can do more than just swapping control and caps lock because the software is pretty sophisticated. For instance, you can define layers like you might find in a custom keyboard setup — pressing one key can trigger a layer that redefines the functions of all of the other keys. There are programmable macros and a mechanism to differentiate between a key being tapped or held.

Since it also works with mice, you can trigger macros from mouse buttons, or remap your keyboard arrow keys to the mouse’s scroll wheel. And you can configure all of this from a web browser.

On the hardware side, the code supports several different off-the-shelf and custom boards. There’s also a nice enclosure to make it look like an off-the-shelf product. There are also serial and Bluetooth versions of the device, which map them to a USB HID connection.

This has applications for accessible devices. We can also envision it being useful with turnkey devices that you might want to customize without having to reverse-engineer the existing software. Because of the mouse/keyboard cross-functionality, this might have been just the ticket for resurrecting an old light pen, for instance. If you want to dive into the HID spec that makes this whole thing work, we can help with that. What will you do with it?

12 thoughts on “Remapping HID For Fun And… Well Fun

  1. For me the killer app of Windows is not SolidWorks, Notepad++, Adobe CS6 or Steam games. It’s not ClearType combined with Consolas font. It’s AutoHotkey.

    Over the years I’ve managed to automate and improve so many things with it. In some cases even using it to almost totally re-purpose software for things its creators never expected.

    1. I can totally agree Autohotkey is awesome and I use it for quite a few automations however I was beaten by some software that is used for Second Life.
      My very basic need was to block the Y axis selectively on my mouse and it worked well as did another program that I tried. Well I say worked well; it worked wonderfully with Windows and ant application I tried it with apart from one, the one I wanted it for.

      The second life viewer just ignored my scripts, well for the mouse movement. All the other scripts worked.

      I was in process of trying to build my own mouse when this project popped up.
      Perfect, simple and just works. Works so well I can even do away with my gaming mouse software and configure with what seems to be total flexibility.

      Yes Autohotkey is wonderful for anything else there is this.

      1. Hey I use Second Life too! Not that often as I used to go there but yeah so fun and relaxing, do you remember the money trees for newbies? I remind a sim entirely dedicated to Arduino! and I used AutoHotkey too, when I was on windows you know, mostly to automate boring things and Photoshop editing (I didn’t know about actions at that time :) then I moved to Linux a couple of years ago and I never looked back, I usually do my boring stuff with bash/Python scripts and some of Autokey and xdotool.

        1. In the other hand I have a red dragon octopus mouse that I repaired and I would like to remap the extra buttons but no idea how to do it in Linux , what a pity I know :) time to visit the man pages I guess

    2. what games should do is let you map any function on any controller to any function in any game. the old arguments of direct input vs xinput vs raw input vs sdl, vs whatever should be a moot point by now. all this middleware mucks up what should be a simple job of getting input.

      on linux i like that you have uinput (at least on the raspian i was using). which i used to map controllers on the i2c bus, gpio or whatever, on my raspberry pi. to actual controllers i can use in games and stuff. not sure if windows has something similar other than 3rd party virtual drivers like vjoy (which is not the same as Vjoy to be really confusing).

      though being able to remap on the fly is nice. though ive considered using esp32s to run a mesh network for all my controllers or just connect them to the network. not sure if you can do hid over wifi but that would be kind of awesome.

  2. The communications filter I still want is one that will give me a hardware, or near hardware, write project switch for storage media.

    Yes, I saw the item about right protecting SD cards. That’s a start. But I want more general solutions, for more interfaces.

    1. I recall law enforcement uses a write protect for hard disks on suspects computers. theirs is quite expensive but it does exist and is on the market for anyone. I have reformatted my backup harddisk by accident on more than one occasion, so i am also interested.
      @nick jfedors hid-remapper only runs on rp2040, the arduino usb host is for atmega32u4 family. I don’t know what drivers are displayed on the latter.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.