From 150b9cbcd16f7d505b2753503753ab033099b6b3 Mon Sep 17 00:00:00 2001 From: Bartosz Stebel Date: Thu, 15 Aug 2024 14:14:57 +0200 Subject: [PATCH] Add support for detecting shift keys alone Fixes: #187 --- moderngl_window/context/base/keys.py | 3 +++ moderngl_window/context/pygame2/keys.py | 3 +++ moderngl_window/context/pyglet/keys.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/moderngl_window/context/base/keys.py b/moderngl_window/context/base/keys.py index 8fad555d..c5e05b78 100644 --- a/moderngl_window/context/base/keys.py +++ b/moderngl_window/context/base/keys.py @@ -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" diff --git a/moderngl_window/context/pygame2/keys.py b/moderngl_window/context/pygame2/keys.py index 737256dc..5094ac7d 100644 --- a/moderngl_window/context/pygame2/keys.py +++ b/moderngl_window/context/pygame2/keys.py @@ -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 diff --git a/moderngl_window/context/pyglet/keys.py b/moderngl_window/context/pyglet/keys.py index 399e1b0d..62f44b18 100644 --- a/moderngl_window/context/pyglet/keys.py +++ b/moderngl_window/context/pyglet/keys.py @@ -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