View previous topic :: View next topic |
Author |
Message |
tiktak n00b

Joined: 07 Sep 2002 Posts: 50 Location: varies.
|
Posted: Tue Mar 27, 2007 3:02 am Post subject: Per-device USB keyboard remapping/ xmodmap - can it be done? |
|
|
Hey all, does anyone of you know whether (and if so, how) it is possible to either:
- remap scancodes to other scancodes of a keyboard on a per-device basis (i.e. when a USB keyboard is attached, run some program to that effect (I learned of none so far)), or
- "at least" run an Xmodmap keycode map on only a specific device (parallel to configurations of other attached keyboards; is it even possible to have per-device scancode->keycode mappings in Xorg simultaneously ??)
What I basically need (for my USB-attachable num-pad keyboard) is either additional scancodes (not colliding with the primary keyboard) I can freely map to keysyms, or at least a separate mapping of the scancodes for just the numpad to a keymap unrelated to the xmodmap of the primary keyboard.
Any hints (even if you know for sure it's currently impossible ^_^) would be very much appreciated. THX1e6 in advance!
EDIT: Another alternative: if you know of a program / usb/kernel/something / Xorg driver that can capture all input from a USB keyboard on a per-device basis and not send it to the normal input layers, but instead to a userspace program / daemon, that might help too.. I will keep looking too... _________________ get_user("tiktak")->post_counter++; |
|
Back to top |
|
 |
dtor Guru

Joined: 19 Jan 2004 Posts: 461 Location: Indiana, USA
|
Posted: Fri Apr 06, 2007 7:57 pm Post subject: Re: Per-device USB keyboard remapping/ xmodmap - can it be d |
|
|
tiktak wrote: | Hey all, does anyone of you know whether (and if so, how) it is possible to either:
- remap scancodes to other scancodes of a keyboard on a per-device basis (i.e. when a USB keyboard is attached, run some program to that effect (I learned of none so far)), or
- "at least" run an Xmodmap keycode map on only a specific device (parallel to configurations of other attached keyboards; is it even possible to have per-device scancode->keycode mappings in Xorg simultaneously ??)
What I basically need (for my USB-attachable num-pad keyboard) is either additional scancodes (not colliding with the primary keyboard) I can freely map to keysyms, or at least a separate mapping of the scancodes for just the numpad to a keymap unrelated to the xmodmap of the primary keyboard.
Any hints (even if you know for sure it's currently impossible ^_^) would be very much appreciated. THX1e6 in advance!
|
To alter keymap of a particular keyboard you need to issue EVIOCSKEYCODE ioctl on corresponding /dev/input/eventX node. This currently works for PS/2 keyboards and some others. The ability to do that for USB keyboards is coming in 2.6.22.
Quote: |
EDIT: Another alternative: if you know of a program / usb/kernel/something / Xorg driver that can capture all input from a USB keyboard on a per-device basis and not send it to the normal input layers, but instead to a userspace program / daemon, that might help too.. I will keep looking too... |
To achieve this your application should open corresponding /dev/input/eventX device and issue EVIOCGRAB ioctl. This will make sure that your application is the only consumer of input evenst from that particular device.
Hope this helps. _________________ Dmitry |
|
Back to top |
|
 |
tiktak n00b

Joined: 07 Sep 2002 Posts: 50 Location: varies.
|
Posted: Mon May 28, 2007 6:29 pm Post subject: |
|
|
I usually do not zombiefy my older topics, but i must say "Thank you very much!" for your answer. You gave a solution not only for 1 of the possibilities, but both!  _________________ get_user("tiktak")->post_counter++; |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|