Skip to content

Commit 1304109

Browse files
committed
Update keyboard state docs.
1 parent 6bb68af commit 1304109

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tcod/event.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,12 +1094,15 @@ def get_keyboard_state() -> np.ndarray:
10941094
Example::
10951095
10961096
state = tcod.event.get_keyboard_state()
1097-
is_w_held = state[tcod.event.Scancode.W]
10981097
1099-
# Get a WASD vector:
1098+
# Get a WASD movement vector:
11001099
x = int(state[tcod.event.Scancode.E]) - int(state[tcod.event.Scancode.A])
11011100
y = int(state[tcod.event.Scancode.S]) - int(state[tcod.event.Scancode.W])
11021101
1102+
# Key with 'z' glyph is held:
1103+
is_z_held = state[tcod.event.KeySym.z.scancode]
1104+
1105+
11031106
.. versionadded:: 12.3
11041107
"""
11051108
numkeys = ffi.new("int[1]")

0 commit comments

Comments
 (0)