Coder Social home page Coder Social logo

usbrawmap's Introduction

usbrawmap

Easy way to assign actions to keyboard scancodes ignored by the USB keyboard driver on Windows.

Example use case

image

This is a Sun Microsystems Type-6 Unix USB keyboard. It looks like your regular old QWERTY 102-odd key keyboard, but it's got a whole 11 keys on the left that you may not recognize. These keys were used on Sun's workstation OSes (e.g. Solaris) and are still recognized by most Unix-family OSes nowadays (including Linux), though they aren't usually assigned to anything.

Problem: Windows's built-in USB HID keyboard driver ignores scancodes it doesn't recognize and doesn't pass them to userland applications. This means that these keys are, for all intents and purposes, unuseable on Windows.

This is where usbrawmap comes in: it uses USBPcap to tap into the raw USB packet stream and detect key presses on those special keys, and performs customizable actions at each key event.

Usage

  1. Install USBPcap from its official website. You may need to reboot your computer.
  2. Run C:\Program Files\USBPcap\USBPcamCMD.exe as administrator, you'll see something like this: image
  3. Search for your keyboard in the list. Here, 3 root hubs are displayed, and only the third one really contains devices, so the right hub is number 3.
  4. Change the general.driver setting in usbrawmap.toml accordingly.
  5. Launch usbrawmap as administrator in the folder containing the configuration file. You should see this: image

Customizing mappings

The configuration file (usbrawmap.toml) uses the following format:

[mappings.SCANCODE]
type = "keys"
keys = ["CONTROL", "O"]

[mappings.SCANCODE]
type = "program"
path = "notepad.exe"

SCANCODE is the USB scancode for the key, with a full list available here.

The key names (CONTROL, ...) must be in the VK format, with a full list available here.

The provided configuration file contains mappings for the Type-6 keyboard shown above, but in practice any scancode can be mapped.

License

This project is licenced under the MIT license.

usbrawmap's People

Contributors

zdimension avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.