question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

incorrect shift-key sequences in __init__.py

See original GitHub issue

Pre:

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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
i-need-to-tell-you-somethingcommented, Jan 11, 2020

This problem is already mentioned in issue #137 . For a temporary workaround you can see there if @Iomira’s solution helps you.

0reactions
jarviscodescommented, Aug 1, 2020

Just here to clean up this issue as @i-need-to-tell-you-something suggested given workarounds are plenty and also #137.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found