How to get keyboard event in Linux console?

Discussion in 'Python' started by Jia,Lu, Oct 4, 2006.

  1. Jia,Lu

    Jia,Lu Guest

    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.
     
    Jia,Lu, Oct 4, 2006
    #1
    1. Advertising

  2. 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
    --
    Sybren Stüvel
    Stüvel IT - http://www.stuvel.eu/
     
    Sybren Stuvel, Oct 4, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. serge
    Replies:
    2
    Views:
    21,162
  2. Jan Winnicki

    Lame qstn: console app and keyboard

    Jan Winnicki, Dec 27, 2004, in forum: C++
    Replies:
    2
    Views:
    285
    Phlip
    Dec 27, 2004
  3. Ben Finney
    Replies:
    2
    Views:
    997
    Egor Bolonev
    Jun 30, 2003
  4. Egor Bolonev
    Replies:
    0
    Views:
    485
    Egor Bolonev
    Jun 30, 2003
  5. Marcin Rodzik

    keyboard hits in a console app

    Marcin Rodzik, Feb 11, 2010, in forum: Java
    Replies:
    7
    Views:
    1,016
    Arne Vajhøj
    Feb 13, 2010
Loading...

Share This Page