summaryrefslogtreecommitdiff
path: root/txtgameengine/__main__.py
diff options
context:
space:
mode:
authorJonas Bernard <public.jbernard@web.de>2021-04-24 04:19:39 +0200
committerJonas Bernard <public.jbernard@web.de>2021-04-24 04:19:39 +0200
commita0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8 (patch)
tree47768e46da3e6682acf6b72dddabaef78d0bfeb8 /txtgameengine/__main__.py
parent635185baac3a2a9c5e50971d994ca7bcdec1d495 (diff)
downloadtxtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.tar.gz
txtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.tar.bz2
txtgameengine-a0a40e9259b9e8be4e677c8c29dfdfb89eb81ce8.zip
Progress at night
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()