LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-25-2007, 03:08 AM   #1
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
Linux and trapping keyboard input


I'm designing a small embedded system. It will only have a serial terminal active, but has a PS/2 keyboard connector. I would like to use a keyboard to activate certain functions on the system.

My question is how do I go about trapping keyboard input from a daemon? Is there any way to directly access the raw keyboard input? Running as root is no problem.

Ideally the daemon will be coded in Python, but I have a feeling this is a task that can only be implemented in C... which isn't nice, being that I don't know C.

Ok, the in-depth description:

I'm making a hardware device that will have about six hardware switches on it. I'm probably using one of the ~$100 boards from a company like EWayCo (www.ewayco.com) and building it into a custom enclosure. The board doesn't offer GPIO, and from what I've heard, serial switches would require a custom made board to work. So I looked at the keyboard encoders from Hagstrom Electronics (http://www.hagstromelectronics.com/) which allow you to just wire up switches, and it hooks up to a PS/2 port.

The problem is that this device will have an LCD screen, an audio output, and pretty much nothing else - so the program to handle the keyboard inputs would need to run as a daemon.

Any thoughts?
 
Old 07-26-2007, 06:08 AM   #2
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Take a look at /dev/input/by-path/ (ls -l). In that directory you can see the mice and keyboards devices (and may be some other) as links to real input devices.
 
  


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
How to get keyboard input from C in Linux yanming Linux - Software 4 07-27-2007 01:51 AM
keyboard input problem pingvina Linux - Software 1 08-07-2006 10:27 AM
Switching input keyboard language in Linux fabianrios Linux - Software 3 09-15-2005 04:46 PM
my mouse input is takes as keyboard input in BASH e1000 Slackware 5 12-08-2003 03:00 PM
No keyboard input seen neo77777 Linux - General 5 07-12-2002 09:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 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