obitus n00b
Joined: 12 May 2002 Posts: 3 Location: Iowa State University
|
Posted: Fri May 17, 2002 10:25 pm Post subject: /dev/console |
|
|
Hi,
I am looking at writing a program to extend the functionality of my keyboard. I have one super-deluxe, fancy keyboard with a bunch of buttons at the top. I have figured out how to get them to work in console mode (using setkeycodes and loadkeys or hacking the keyboard driver a bit) and I have also figured out how to map them in X (using xev and xmodmap) to different keys but I really wanted to have mozilla executed when I hit the WWW button. I realize that this can be done on a case by case basis with most window managers but I really wanted to avoid that...I wanted something that was a little more generic. So I went out and did a little research and saw that X gets raw scan codes from /dev/console and does all its own mappings and conversions. To me, logically, that would be the place to go. If there was a way to see what was going through /dev/console, a program could act on a set of keycodes. Good in theory, difficult to put into practice. Opening /dev/console works fine. Reading from it works fine too--you get the scan codes--but then X no longer gets any keys (obviously because you are reading them and removing them) Peeking them isn't too helpful because if nothing has changed, you get the same scan code...you have to wait for X to process the scan codes with no guarantees that you are going to see everything code that goes by. My next thought is this, can I rename/move /dev/console to something else, say /dev/foo and then create dummy device that takes acts as a fifo queue and then just let my program act as a bridge between. My program reads whats coming into /dev/foo and if it is one of the scan code patterns I like, act on it, otherwise just dump it over to /dev/console. Is this possible? Is there a better way to do it? Should I look at the console driver?
Thanks,
Josh |
|