项目作者: B83C

项目描述 :
Simple keymapping employing ioctl which works in both X11 and console. Not a daemon, its execution is one-shot.
高级语言: C
项目地址: git://github.com/B83C/ioctl_keymapping.git
创建时间: 2020-12-05T02:05:02Z
项目社区:https://github.com/B83C/ioctl_keymapping

开源协议:

下载


IOCTL KEYMAPPING UTILITY

Simple keymapping employing ioctl which works in both X11 and console. Not a daemon, its execution is one-shot.

INSTALLATION

Paste the commands into your terminal and hit enter

  1. git clone https://github.com/b83c/ioctl_keymapping
  2. cd ioctl_keymapping
  3. make clean && make install #This will install the binary file into /usr/local/bin and at the same time, create a systemd service.

CONFIGURATION

By default, config.h doesn’t exist in the repository, and is copied from config.def.h at compile time. And of course, you can manually make a copy of your own.
Below is an example that works on most laptops:

  1. //Format: {KEY_TO_BE_MAPPED, MAPPED_KEY}
  2. static unsigned scancode_keycodes[][2] = {
  3. {KEY_KP1, KEY_LEFT},
  4. {KEY_KP2, KEY_DOWN},
  5. {KEY_KP3, KEY_UP},
  6. {KEY_KPMINUS, KEY_RIGHT}
  7. };
  8. static char* keyboards[] = {
  9. "AT Translated Set 2 keyboard" //Do xinput list to retrieve your keyboard name.
  10. }

TODO

Reduce syscalls and boost performance.

LICENSE

none