LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-07-2012, 12:09 PM   #1
roboninja123
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
Intercept USB Keyboard Keycode Info


Hey there,

I am trying to intercept keycode information and print the last recieved keycode to an entry in the /proc file system. As of now, I have modified input.c and keyboard.c. Each time I have created a static variable that is to contain the last keycode. I then go into the keycode handling functions (input_fetch_keycode()/input_get_keycode() in input.c and getkeycode() in keyboard.c) and modify them to assign the keycode it is about to return to the static variable.

It seems that every time I try to do this, I get zeros for the output values, as if there is never a value assigned to the static variable in the first place. I am working under the assumption that everytime there is a key pressed on the USB keyboard, that one of these functions will be called, is that a correct assumption? Or are these drivers meant for a PS/2 keyboard and are never being called because I am using a USB keyboard? And if that is the case, what source file will I have to edit to obtain the keycode values?
 
Old 08-07-2012, 09:50 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,735
Blog Entries: 28

Rep: Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277Reputation: 6277
You might want to take a look at xev.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [Keyboard Multimedia keys] Multiple scancodes mapped to same keycode Vhann Linux - Laptop and Netbook 1 04-21-2009 12:28 AM
keyboard capital 'S' stopped working (shift + keycode 39 is stolen) desimo Linux - Software 2 04-25-2007 10:10 AM
SunPCI keyboard intercept. Brian Knoblauch Solaris / OpenSolaris 0 03-10-2006 10:17 AM
unsupported keycode from USB numeric keypad wilsonronl Linux - Hardware 0 09-10-2005 04:36 PM
usb keyboard and soundcard conflict (sound set to keyboard?) netsurf Linux - Hardware 2 04-09-2005 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration