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

Keys are interpreted incorrectly on Linux #52

Open
GeorgeCiesinski opened this issue Mar 6, 2020 · 2 comments
Open

Keys are interpreted incorrectly on Linux #52

GeorgeCiesinski opened this issue Mar 6, 2020 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@GeorgeCiesinski
Copy link
Owner

Description

Depending on if the program is ran on Windows or Linux, the key codes are interpreted differently. This results in the numpad keys and some letter keys being interpreted incorrectly. Further inspection revealed that the virtual key codes appear to be about 32 apart from each other for the letter keys, and different amounts apart in other types of keys (!! is only 16 apart). Numpad keys don't register virtual key codes.

Example of the behavior when typing !reload:

Type Linux Windows
Read as: Key.shift Key.shift
Virtual Key: 33 49
Read as: ! !
Virtual Key: 114 82
Read as: r r
Virtual Key: 101 69
Read as: 5 e
Virtual Key: 108 76
Read as: l l
Virtual Key: 111 79
Read as: o o
Virtual Key: 97 65
Read as: 1 a
Virtual Key: 100 68
Read as: 4 d

Example of the behavior when typing out numpad 0 - 9

Type Linux Windows
Virtual Key: None 96
Read as: 0 0
Virtual Key: None 97
Read as: 1 1
Virtual Key: None 98
Read as: 2 2
Virtual Key: None 99
Read as: 3 3
Virtual Key: None 100
Read as: 4 4
Virtual Key: 65437 101
Read as: <65437> 5
Virtual Key: None 102
Read as: 6 6
Virtual Key: None 103
Read as: 7 7
Virtual Key: None 104
Read as: 8 8
Virtual Key: None 105
Read as: 9 9

Mac testing is required.

Steps to reproduce the behavior:

  1. Download the repo and install all dependencies
  2. Checkout the branch feature/delimiter-check (This branch has test outputs built in)
  3. Run text-script.py while in the textscript cwd
  4. Try typing !reload and numpad 0-9

Expected behavior

Text-Script should have interpreted the virtual key codes the same way on all OS's.

Setup

  • OS: Linux
  • Running feature/delimiter-check from Pycharm

Resources

@GeorgeCiesinski GeorgeCiesinski added the bug Something isn't working label Mar 6, 2020
@GeorgeCiesinski GeorgeCiesinski added this to the 2.0 Release milestone Mar 6, 2020
@GeorgeCiesinski GeorgeCiesinski self-assigned this Mar 6, 2020
@GeorgeCiesinski
Copy link
Owner Author

Posted on Stack Overflow to get a better understanding.

@GeorgeCiesinski
Copy link
Owner Author

Found a more complete docs file that has a more complete breakdown of Pynput: https://pynput.readthedocs.io/en/latest/keyboard.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant