Discussion:
matrix keyboard problem
Takács Áron
2006-11-08 10:53:08 UTC
Permalink
Hi,

I am using a PXA270 board with a matrix keypad. I've copied a
scankeyboard driver from handhelds.org and it seems to work. I can at
bootup:

input: pxa27x-keyboard as /class/input/input0

With some printks I figured out, that it also scans the matrix well and
submits the keys with input_report_key(...).
My only problem is that I don't know where I can access the pressed
buttons? I've tried cat /dev/tty and /dev/console, but I cannot see any
output.
Thank you for your help!

Áron Takács

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Takács Áron
2006-11-08 11:59:28 UTC
Permalink
Hi, Dylan,

thank you for your advice! Now I can read /dev/input/event0, but I get a
lot of weird characters on every button-push. And they are streaming
while I hold a button pushed. The input_report_key function is only
called 12 times (for every button in the matrix) on a button push and
another 12 times on a button release.
And how can I get the characters onto the console?
Thanks!

Áron

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Takács Áron
2006-11-08 12:42:33 UTC
Permalink
I have some new observations regarding the matrix keyboard problem:

When I do cat /dev/tty0 (in telnet terminal) the characters
corresponding the pushed buttons are written onto my framebuffer.
Without doing cat /dev/tty0 characters are not printed onto screen.

Áron Takács

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Russell King - ARM Linux
2006-11-08 23:11:24 UTC
Permalink
Post by Takács Áron
With some printks I figured out, that it also scans the matrix well and
submits the keys with input_report_key(...).
My only problem is that I don't know where I can access the pressed
buttons? I've tried cat /dev/tty and /dev/console, but I cannot see any
output.
/dev/tty0

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Takács Áron
2006-11-09 11:05:12 UTC
Permalink
Hi, Dylan,

I've added "tty0::respawn:-/bin/sh" to my inittab file and now I get a
prompt on my framebuffer screen and the characters are printed after
that prompt when keys are pushed. I think it's ok.
But I want to start a graphical application and want my buttons to be
read by it. When I start it over telnet, the graphical screen gets
disturbed when I push the buttons.
Sorry for these stupid questions but I really confused with ttys and
consoles... :-(

Áron

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Russell King - ARM Linux
2006-11-09 11:47:14 UTC
Permalink
Post by Takács Áron
I've added "tty0::respawn:-/bin/sh" to my inittab file and now I get a
prompt on my framebuffer screen and the characters are printed after
that prompt when keys are pushed. I think it's ok.
But I want to start a graphical application and want my buttons to be
read by it. When I start it over telnet, the graphical screen gets
disturbed when I push the buttons.
Sorry for these stupid questions but I really confused with ttys and
consoles... :-(
You essentially need to switch the console to graphical mode - KDSETMODE
with the argument set to KD_GRAPHICS. Don't forget to restore it when
your graphical app shuts down.

This must be done on the VT (iow tty0) device, not stdin/stdout/stderr.

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Takács Áron
2006-11-09 14:35:25 UTC
Permalink
Hi Dylan and Russel,

I've added this line to inittab:

tty0::once:/prog/start_app

And now, my graphical application can take the characters from
/dev/tty0. It's working.
Thank you both for the hints!

Áron



-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Loading...