Skip to content

Commit

Permalink
Add support for detecting shift keys alone
Browse files Browse the repository at this point in the history
Fixes: #187
  • Loading branch information
implr committed Sep 1, 2024
1 parent 2cf5d63 commit 150b9cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions moderngl_window/context/base/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class BaseKeys:
RIGHT: Any = "undefined"
UP: Any = "undefined"
DOWN: Any = "undefined"
LEFT_SHIFT: Any = "undefined"
RIGHT_SHIFT: Any = "undefined"
LEFT_CTRL: Any = "undefined"

TAB: Any = "undefined"
COMMA: Any = "undefined"
Expand Down
3 changes: 3 additions & 0 deletions moderngl_window/context/pygame2/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class Keys(BaseKeys):
RIGHT = pygame.K_RIGHT
UP = pygame.K_UP
DOWN = pygame.K_DOWN
LEFT_SHIFT = pygame.K_LSHIFT
RIGHT_SHIFT = pygame.K_RSHIFT
LEFT_CTRL = pygame.K_LCTRL

TAB = pygame.K_TAB
COMMA = pygame.K_COMMA
Expand Down
3 changes: 3 additions & 0 deletions moderngl_window/context/pyglet/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class Keys(BaseKeys):
RIGHT = key.RIGHT
UP = key.UP
DOWN = key.DOWN
LEFT_SHIFT = key.LSHIFT
RIGHT_SHIFT = key.RSHIFT
LEFT_CTRL = key.LCTRL

TAB = key.TAB
COMMA = key.COMMA
Expand Down

0 comments on commit 150b9cb

Please sign in to comment.