We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bb68af commit 1304109Copy full SHA for 1304109
tcod/event.py
@@ -1094,12 +1094,15 @@ def get_keyboard_state() -> np.ndarray:
1094
Example::
1095
1096
state = tcod.event.get_keyboard_state()
1097
- is_w_held = state[tcod.event.Scancode.W]
1098
1099
- # Get a WASD vector:
+ # Get a WASD movement vector:
1100
x = int(state[tcod.event.Scancode.E]) - int(state[tcod.event.Scancode.A])
1101
y = int(state[tcod.event.Scancode.S]) - int(state[tcod.event.Scancode.W])
1102
+ # Key with 'z' glyph is held:
1103
+ is_z_held = state[tcod.event.KeySym.z.scancode]
1104
+
1105
1106
.. versionadded:: 12.3
1107
"""
1108
numkeys = ffi.new("int[1]")
0 commit comments