Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some keys not being read on Windows #8

Closed
frastlin opened this issue Jul 22, 2015 · 2 comments
Closed

Some keys not being read on Windows #8

frastlin opened this issue Jul 22, 2015 · 2 comments

Comments

@frastlin
Copy link

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.

@frastlin
Copy link
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")

@frastlin
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant