Skip to content

Keys are interpreted incorrectly on Linux #52

@GeorgeCiesinski

Description

@GeorgeCiesinski

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

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions