Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/dev/console
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
obitus
n00b
n00b


Joined: 12 May 2002
Posts: 3
Location: Iowa State University

PostPosted: Fri May 17, 2002 10:25 pm    Post subject: /dev/console Reply with quote

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
Back to top
View user's profile Send private message
obitus
n00b
n00b


Joined: 12 May 2002
Posts: 3
Location: Iowa State University

PostPosted: Sat May 18, 2002 5:51 am    Post subject: funkey Reply with quote

I found a project someone had already started...I guess thats kind of what I had in mind...it patches the kernel to send the special keys to a seperate device. Here is the URL if anyone is interested:
http://rick.vanrein.org/linux/funkey/

Josh
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
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