Re: Reading Keyboard Scan Codes

Discussion in 'Python' started by Francois Pinard, Jul 24, 2003.

  1. [François Pinard]

    > [...] I do not know if reading scan codes or key codes is easily done
    > within X, nor on MS-Windows. I would like finding or discovering recipes
    > in this area. So, please share your tricks in this area, if any! :)


    [Bjorn Pettersen]

    > I'm assuming you can use the msvcrt module:


    > >>> def getch():

    > ... import msvcrt
    > ... while not msvcrt.kbhit(): pass
    > ... return msvcrt.getch()
    > ...
    > >>> getch()

    > 'a'
    > >>>


    This does not give scan codes (or key codes of some sort). I would like
    being able to detect, for example, if Ctrl is being held while Keypad-5
    is entered, or any other such (possibly unusual) combination of keys.

    --
    François Pinard http://www.iro.umontreal.ca/~pinard
    Francois Pinard, Jul 24, 2003
    #1
    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. =?ISO-8859-1?Q?Rapha=EBl?=

    How to scan Keyboard in Perl or else on Linux ?

    =?ISO-8859-1?Q?Rapha=EBl?=, Nov 4, 2004, in forum: Perl
    Replies:
    2
    Views:
    861
    =?ISO-8859-1?Q?Rapha=EBl?=
    Nov 9, 2004
  2. aman

    scan codes

    aman, Mar 1, 2004, in forum: C Programming
    Replies:
    3
    Views:
    2,336
    E. Robert Tisdale
    Mar 1, 2004
  3. Michael Bendzick

    Reading Keyboard Scan Codes

    Michael Bendzick, Jul 23, 2003, in forum: Python
    Replies:
    2
    Views:
    1,314
    Alan Gauld
    Jul 24, 2003
  4. Bjorn Pettersen

    RE: Reading Keyboard Scan Codes

    Bjorn Pettersen, Jul 23, 2003, in forum: Python
    Replies:
    0
    Views:
    524
    Bjorn Pettersen
    Jul 23, 2003
  5. Replies:
    2
    Views:
    2,792
    Malcolm
    Aug 20, 2005
Loading...

Share This Page