# HG changeset patch # User Sam # Date 1706976214 -25200 # Node ID cbbb9abe256e54227279e930b4946f77cd302a54 # Parent 604f1e7be026be92171dbaf4816493ef424a4617 add: nicer key-stroke test, cleanup test-resource files diff -r 604f1e7be026 -r cbbb9abe256e tests/resources/default/DejaVuSans.ttf Binary file tests/resources/default/DejaVuSans.ttf has changed diff -r 604f1e7be026 -r cbbb9abe256e tests/resources/default/default_cube.glb Binary file tests/resources/default/default_cube.glb has changed diff -r 604f1e7be026 -r cbbb9abe256e tests/resources/default/donut.glb Binary file tests/resources/default/donut.glb has changed diff -r 604f1e7be026 -r cbbb9abe256e tests/resources/default/flag.png Binary file tests/resources/default/flag.png has changed diff -r 604f1e7be026 -r cbbb9abe256e tests/resources/default/key.ogg Binary file tests/resources/default/key.ogg has changed diff -r 604f1e7be026 -r cbbb9abe256e tests/test_font.nim --- a/tests/test_font.nim Sat Feb 03 21:40:25 2024 +0700 +++ b/tests/test_font.nim Sat Feb 03 23:03:34 2024 +0700 @@ -25,6 +25,7 @@ scene.add main_text scene.add help_text engine.loadScene(scene) + mixer[].loadSound("key", "key.ogg") while engine.updateInputs() == Running and not engine.keyIsDown(Escape): if engine.windowWasResized(): @@ -39,17 +40,21 @@ Key.J, Key.K, Key.L, Key.M, Key.N, Key.O, Key.P, Key.Q, Key.R, Key.S, Key.T, Key.U, Key.V, Key.W, Key.X, Key.Y, Key.Z]: if engine.keyWasPressed(c): + discard mixer[].play("key") if engine.keyIsDown(ShiftL) or engine.keyIsDown(ShiftR): main_text.text = main_text.text & ($c).toRunes else: main_text.text = main_text.text & ($c).toRunes[0].toLower() if engine.keyWasPressed(Enter): + discard mixer[].play("key") main_text.text = main_text.text & Rune('\n') if engine.keyWasPressed(Space): + discard mixer[].play("key") main_text.text = main_text.text & Rune(' ') # remove character if engine.keyWasPressed(Backspace) and main_text.text.len > 0: + discard mixer[].play("key") main_text.text = main_text.text[0 ..< ^1] # alignemtn with F-keys