How to get keyboard event in Linux console?

J

Jia,Lu

Hi all,
I want to deal keyboard event in Linux console.
Example: I Create a deamon at background and when I press F1 key then
print Hello at Console.

Can python do it? with which module?

Thanks.
 
S

Sybren Stuvel

Jia,Lu enlightened us with:
I want to deal keyboard event in Linux console.
Example: I Create a deamon at background and when I press F1 key
then print Hello at Console.

Type "who" and see which PTY you're connected to:

sybren pts/0 2006-10-04 07:55 (klappie.stuvel.eu)

So I'm connected to pts/0. If you read from /dev/pts/0, you'll see
everything I type.

Sybren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top