Skip to content

Some keys not being read on Windows #8

Closed

Description

@frastlin

On windows 7 64 bit running python 32, none of the function keys, arrow keys or mod keys are read.
So f1 doesn't even trigger anything, up arrow doesn't trigger anything and ctrl doesn't trigger anything.

Activity

  1. frastlin commented on Jul 23, 2015

    @frastlin
    Author

    OK, I have done some research and so what I can do is:

    1. in readchar just have ascii values, but in readkey return "up" "down" "escape" "return" "tab" "backspace"...
      The current Windows readchar implementation is over complex.
      I will submit a request for a better implementation.
      I just would like to make sure that I am following what is happening on Linux and the mac so I can do something like:
    from readchar import readkey
    
    while True:
        key = readkey()
        if key == "return":
            print("Hello world")
        elif key == "escape":
            break
        elif key == "a":
            print("This is an a")
        elif key == "up":
            print("This is an up arrow")
  2. frastlin commented on Jul 23, 2015

    @frastlin
    Author

    OK, I have modified the code quite a lot, but now it looks much easier to use and everything in Windows returns like it should.
    I don't have Linux right now, so have not checked if everything matches. Checkout my code:
    Here
    It is in several commits, so let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions