The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SCO 6.0-Keys in keyboard function differently chssastry SCO 4 08-31-2009 08:46 PM
Some or all keys on the keyboard don't work iBot OS X Support RSS 0 04-25-2009 10:45 PM
How to read arrow keys on really old bash? simonb Shell Programming and Scripting 1 05-01-2006 10:27 AM
arrow keys / special keys raguramtgr UNIX for Dummies Questions & Answers 3 02-20-2004 02:45 AM
How can I map Unix keyboard for PC keyboard simhab UNIX for Advanced & Expert Users 1 03-06-2002 11:29 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-25-2009
siva4ever siva4ever is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 6
How to read keys from USB keyboard on AT91SAM9260

Hi Everyone,

I am using 2.6.26.3-olimex kernel(Embedded system) running on AT91SAM9260. I am using a Logitech USB keyboard.

It is detected as "/dev/input/event0".

I don't know how to detect key press events and read the keys?

Why can't I read the keys using scanf() like funtions?

Can anyone help me?

Regards,
Siva
  #2 (permalink)  
Old 08-28-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,929
Your embedded system's kernel may not have been built with keyboard support, being an embedded system...
  #3 (permalink)  
Old 10-01-2009
siva4ever siva4ever is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 6
Thanks for your response.

I have enabled the following options in the menuconfig file while building uImage.

Input Device Support --> Event Interface
Keyboards --> AT Keyboard
HID Devices --> USB Human Interface Device support
HID Devices --> PID device support
Special HID Drivers --> Logitech and Logitech force feedback

After booting the kernel, USB key board detected as "/dev/input/event0".

I don't know why I can't use this as stdin?

Am I missing some thing here?
  #4 (permalink)  
Old 10-01-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,929
You're getting closer.

What kernel version? What options may depend on it. In my kernel at least, 2.6.27, you also need the <*>Generic Input Layer, under Input Device Support in Device Drivers.
  #5 (permalink)  
Old 4 Weeks Ago
siva4ever siva4ever is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 6
How to read keys from USB board

I have enabled Generic Input Layer, under Input Device Support in Device Drivers.

But still I can not use USB key board as stdin.

Have I missed something else?
  #6 (permalink)  
Old 3 Weeks Ago
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,929
I'm reaching the limits of my knowledge here, I'm not sure how Linux decides what keyboard device to use with what physical terminal device. I do know that the keyboard does not literally become stdin -- that'd be an easy fix if it did, but the event interface reports raw key codes, not actual keystrokes. Instead linux pairs a physical keyboard with some sort of physical output device in order to create a terminal device to interact with.

I don't know what programs your embedded system actually has. I don't know what your embedded system actually is beyond what processor runs it. Your system may just not be configured to use it. The content of /etc/inittab, and the complete listing of /dev/, might be useful to figuring this out.

It'd also help if you replied more than once every three weeks.

Last edited by Corona688; 3 Weeks Ago at 12:20 PM..
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0