1

I just managed to set up a mini Bluetooth keyboard, along with my regular USB keyboard. I want to be able to press a single button on my Bluetooth keyboard and have it control various multimedia functions - press "q" to start playing music, just as a random idea.

However, the obvious problem with that is that if I map them the normal way, then it interferes with my regular keyboard, and so I have to figure out a way to take inputs that might use the same keycode from two separate keyboards and use them for completely different purposes.

Is this even possible? I know that Linux can differentiate between different keyboards, but I don't know if it can go to this extent.

  • It's possible, but not easy: (1) Prevent X from recognizing the keyboard (xinput, xorg.conf), (2) monitor /dev/input/eventX (or better an udev alias) for your second keyboard for keypresses, (3) inject key events as appropriate, e.g. with xdotool. All parts have been covered in questions on this site. – dirkt Mar 2 '17 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.