key detect

Discussion in 'Python' started by Alex Taslab, Apr 25, 2007.

  1. Alex Taslab

    Alex Taslab Guest

    Hi everybody, does anyone know how to detect a key press from a
    keyboard. Well I do know how to do that, but i need to detect just one
    press and ignore the others. I mean, my program checks an input from the
    outside (a sensor) and i emulate that signal as a keypress, but the
    sensor doesn`t send the signal as a unique pulse y just keeps sending
    signal during some seconds, so that is like to be pressing one key for a
    period of time. How can i take that first press of a key and ignore the
    others? I am using pygtk. thanks everybody!
    Alex Taslab, Apr 25, 2007
    #1
    1. Advertising

  2. Alex Taslab

    hlubenow Guest

    Alex Taslab wrote:

    > Hi everybody, does anyone know how to detect a key press from a
    > keyboard. Well I do know how to do that, but i need to detect just one
    > press and ignore the others. I mean, my program checks an input from the
    > outside (a sensor) and i emulate that signal as a keypress, but the
    > sensor doesn`t send the signal as a unique pulse y just keeps sending
    > signal during some seconds, so that is like to be pressing one key for a
    > period of time. How can i take that first press of a key and ignore the
    > others? I am using pygtk. thanks everybody!


    Perhaps you could emulate the sensor-signal as something else than a
    keypress, perhaps pipe the event-data into some temporary file or so.

    H.
    hlubenow, Apr 26, 2007
    #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. Shanknbake
    Replies:
    3
    Views:
    12,656
    Roedy Green
    Oct 9, 2005
  2. Si
    Replies:
    3
    Views:
    753
    Andrey Kuznetsov
    Feb 28, 2006
  3. Ben Pfaff

    Re: Can I detect "enter" key using scanf?

    Ben Pfaff, Aug 5, 2003, in forum: C Programming
    Replies:
    0
    Views:
    672
    Ben Pfaff
    Aug 5, 2003
  4. Dan Pop

    Re: Can I detect "enter" key using scanf?

    Dan Pop, Aug 6, 2003, in forum: C Programming
    Replies:
    0
    Views:
    1,402
    Dan Pop
    Aug 6, 2003
  5. M P
    Replies:
    1
    Views:
    455
Loading...

Share This Page