summaryrefslogtreecommitdiff
path: root/txtgameengine/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'txtgameengine/__main__.py')
-rw-r--r--txtgameengine/__main__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/txtgameengine/__main__.py b/txtgameengine/__main__.py
index a56571e..71085e1 100644
--- a/txtgameengine/__main__.py
+++ b/txtgameengine/__main__.py
@@ -4,6 +4,7 @@ from .scenes import SceneTxtGameApp, Scene
from pathlib import Path
from .shaders import TextureShader
from .twod.textures import Texture, TEXTURE_FOLDER
+from.input.keyboard import ModKey, KeyboardEvent
shader_path = Path(__file__).parent / 'shaders'
@@ -75,9 +76,13 @@ class TestApp(SceneTxtGameApp):
def init(self):
super().init()
self.render.setup_vertex_arrays()
+ self.handler.register_keyboard_callback(self.handler.keyboard_callback()
+ .with_mod_key(ModKey.CONTROL)
+ .build(lambda key_event: print(key_event.keycode)))
# self.platform.check_debug()
+
if __name__ == '__main__':
a = TestApp((640, 480), "OpenGL window")
a.start()