On Thu, 10 Jul 2014, Will Godfrey wrote:
On Thu, 10 Jul 2014 00:01:13 -0700 (PDT)
Len Ovens <len(a)ovenwerks.net> wrote:
I have used sockets for this stuff before, but
would prefer not to. I am
going to figure out udev.
Brave man!
Where do we send the flowers? :)
Hacking udev turned out to be quite easy. created a file:
/lib/udev/rules.d/midikb.rules ( it should actually be 90-midikb.rules to
fit with all else, but it gets loaded after all else so it works this way
too) It has one line:
KERNEL=="event*", GROUP="input", MODE="0660"
And now after boot I have:
$ ls -l /dev/input/*
crw-rw---- 1 root input 13, 64 Jul 10 15:35 /dev/input/event0
crw-rw---- 1 root input 13, 65 Jul 10 15:35 /dev/input/event1
crw-rw---- 1 root input 13, 66 Jul 10 15:35 /dev/input/event2
crw-rw---- 1 root input 13, 67 Jul 10 15:35 /dev/input/event3
crw-rw---- 1 root input 13, 68 Jul 10 15:35 /dev/input/event4
crw-rw---- 1 root input 13, 69 Jul 10 15:35 /dev/input/event5
crw-rw---- 1 root input 13, 70 Jul 10 15:57 /dev/input/event6
crw-rw---- 1 root input 13, 71 Jul 10 15:58 /dev/input/event7
6 is my extra USB kb, 7 is part of it too, but I am not sure what... maybe
the missing keys from event6? (though why would U and I be separate?)
Anyway, event2 is my system ps/2 kb and event3 is the ps/2 mouse. Event4
is labeled platform-eeepc-wmi-event and I think event 5 is my power
button. (my system keyboard is an old AT ... with AT/XT switch even)
Anyway, actkbd -s -d /dev/input/event6 displays my scancodes like this:
Keys: 35
Keys: 34+35
The way it works (with these options and no config for actkbd) is that key
35 was pressed first and 34 after, but before 35 was released. If I then
release 35, then 34 shows on it's own. So each event (press or release)
shows what keys are still active. I do not have "grab" turned on and so
the actual key press is still being fed to Xorg as well. I can hold the
key long enough for repeat to start for Xorg, but actkbd does not show all
of the repeats, just the original key press. I do not know if this is
unique to USB kb or works with AT kb as well. ps/2 keyboards have three
modes, 1 = xt (not used) 2 = at (everything can do this) 3 = ps/2 (more
options such as turning typematic off) Not sure what USB does, but it
probably looks like a ps/2 to be able to work at boot time.
--
Len Ovens
www.ovenwerks.net