incorrect shift-key sequences in __init__.py
See original GitHub issuePre:
On a Belgian AZERTY keyboard, keys like ! $ & < : ; ( )
are non-shift keys.
Problem:
In [1]: import pyautogui
In [2]: pyautogui.write('"')
In [3]: 3
3 would be the result with a shift key pressed.
Expected:
...
in[3]: "
Cause:
__init__.py
’s isShiftCharacter()
checks if the characters are in a hardcoded string:
return character.isupper() or character in '~!@#$%^&*()_+{}|:"<>?'
Solution:
Starting from the original keys (I haven’t checked keys that aren’t in the string), this would be a better set of Shift-enabled keys for Belgian AZERTY: ~@#%^*_+{}|>?
Allthough it would be cleaner if we could somehow test the current keyboard layout and set the string of shift-characters that way.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
pygame keydown combinations (ctrl + key or shift + key)
I have some python code with keydown events happening ...
Read more >How to Make Hotkeys in Python - Nitratine
This demonstrates how to make a script to detect combinations of keypresses or even single keys pressed in Python. The script will use ......
Read more >Invalid modifier in string for command unset "\C-;"
The command (global-unset-key "\C-;") fails with the message: Invalid modifier in string . Perhaps because of the special character ; . What is ......
Read more >KeyboardEvent.key - Web APIs | MDN
For a given key press, the sequence of KeyboardEvent s fired is as follows ... Press and hold the Shift key, then press...
Read more >Pygame tutorial Documentation - Read the Docs
Pygame is a multimedia library for Python for making games and multimedia ... pygame.init() ... If it occurs, we set running to False:....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This problem is already mentioned in issue #137 . For a temporary workaround you can see there if @Iomira’s solution helps you.
Just here to clean up this issue as @i-need-to-tell-you-something suggested given workarounds are plenty and also #137.