From a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8 Mon Sep 17 00:00:00 2001 From: Jonas Bernard Date: Sat, 24 Apr 2021 04:19:39 +0200 Subject: Progress at night --- txtgameengine/__main__.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'txtgameengine/__main__.py') 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() -- cgit