How to read keys from USB keyboard on AT91SAM9260


 
Thread Tools Search this Thread
Operating Systems Linux How to read keys from USB keyboard on AT91SAM9260
# 1  
Old 08-25-2009
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  
Old 08-28-2009
Your embedded system's kernel may not have been built with keyboard support, being an embedded system...
# 3  
Old 10-01-2009
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  
Old 10-01-2009
You're getting closer. Smilie

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  
Old 10-26-2009
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  
Old 10-26-2009
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; 10-26-2009 at 01:20 PM..
# 7  
Old 11-06-2009
How to read keys from USB keyboard on AT91SAM9260

Thanks for your response.

I am using AT91SAM9260 controller with Linux 2.6.30.4 kernel.

I have attached my /etc/initab/ entries and /dev/ entries.

Please have a look into them and share your views.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

Configure X windows with both keyboard and USB barcode reader

Greetings. Seeking guidance on adding a USB barcode reader (BCR) to an HP c3750 workstation with HP-UX 11.11 which is essentially configuring X windows to accept input from both a primary keyboard and a secondary keyboard that happens to be the BCR. Historically, I have successfully added a BCR... (2 Replies)
Discussion started by: mnkaltenbach
2 Replies

2. Shell Programming and Scripting

While read won't run keyboard function

I am using while read do/ done to retrieve menu item. Works as advertised, no problem. I am using this hack function "pause" to stop script execution and wait for keyboard "enter" key to continue. Sort of break point function. Also works fine with one exception - it does not work when used... (4 Replies)
Discussion started by: annacreek
4 Replies

3. Shell Programming and Scripting

Input keyboard keys upon program launch

Hey guys, first post! I want to write a script that will wait 1 second and then input the keys CTRL+ALT+J to the application i just opened. The program is dosbox, and thay key combination starts video recording :) I have no idea how to program this, can anyone help please? thanks in advance! (2 Replies)
Discussion started by: brunobliss
2 Replies

4. UNIX for Dummies Questions & Answers

read from terminal/keyboard > /dev/tty

Hi, I need to provide more than one character to "> /dev/tty" through terminal/keyboard input, I have this: ok=false while do echo " Enter r1 to reformat " > /dev/tty read choice case $choice in ) echo " bla bla bla " ;; done However, in this way,... (3 Replies)
Discussion started by: Gery
3 Replies

5. Solaris

Keys on Keyboard stop working

Hello, I hope I put this in the right forum... I searched for similar threads, but I couldn't find any that seem to deal with the problem I am having. My workplace is using (among other Solaris-machines) Dell Dimension T3500 as workstations (running Solaris 10 X86 10/09 u8,... (0 Replies)
Discussion started by: areichart
0 Replies

6. SCO

SCO 6.0-Keys in keyboard function differently

Sir I have HP installed with SCO 6.0. The problems are (1) some keys in board like 'del' 'backspace', 'pageup/dn" do not function and display some special characters on conole. (2) Files transferred from Windows machine invariably contain control Z/M characters. How to resolve these issues. ... (4 Replies)
Discussion started by: chssastry
4 Replies

7. Shell Programming and Scripting

Detect USB keyboard and other peripherals

Hi there, I have a Debian machine without any peripherals (no screen, no keyboard, etc.). I'd like to be able to detect and log when someone plugs a USB keyboard. Something like : 2009-07-04 12:21 warning: keyboard pluged! Is that possible? I see two ways : 1. Either actively react to the... (4 Replies)
Discussion started by: chebarbudo
4 Replies

8. Shell Programming and Scripting

How to read arrow keys on really old bash?

I would like to get a script to respond to arrow key presses to scroll up and down a menu. The platform is CDLinux which uses a prehistoric version of bash, version 1.14.7. I would like to do something like "read -sn 1 keyin" but the "read" command is so primative that it only has the -r... (1 Reply)
Discussion started by: simonb
1 Replies

9. UNIX for Dummies Questions & Answers

USB keyboard in Solaris

I have a USB keyboard/mouse combo hooked up to an x86 box and when it loads the mouse works fine, but the ctrl, shift, alt, and i think the function keys don't do anything. Is there a setting I need to change, or a way to manually configure them. There are no drivers, it is supposed to emulate a... (0 Replies)
Discussion started by: Winzernotman
0 Replies
Login or Register to Ask a Question