# HG changeset patch # User Sam # Date 1706976214 -25200 # Node ID b1c9374c70806cb50a24d07dd4f850f44480f7f4 # Parent 1e3c242435af2cde03c903d601db99c8510bbfae add: nicer key-stroke test, cleanup test-resource files diff -r 1e3c242435af -r b1c9374c7080 tests/resources/default/DejaVuSans.ttf Binary file tests/resources/default/DejaVuSans.ttf has changed diff -r 1e3c242435af -r b1c9374c7080 tests/resources/default/default_cube.glb Binary file tests/resources/default/default_cube.glb has changed diff -r 1e3c242435af -r b1c9374c7080 tests/resources/default/donut.glb Binary file tests/resources/default/donut.glb has changed diff -r 1e3c242435af -r b1c9374c7080 tests/resources/default/flag.png Binary file tests/resources/default/flag.png has changed diff -r 1e3c242435af -r b1c9374c7080 tests/resources/default/key.ogg Binary file tests/resources/default/key.ogg has changed diff -r 1e3c242435af -r b1c9374c7080 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