v2 / vlib / gg / keyboard.v
8 lines · 7 sloc · 260 bytes · 17695801eab63685f46517b22e1b46223baa37d2
Raw
1module gg
2
3// is_key_down returns whether the given key is currently pressed.
4// You can use this, if you do not want to implement your own key event handling.
5@[inline]
6pub fn (mut ctx Context) is_key_down(k KeyCode) bool {
7 return ctx.pressed_keys[int(k)]
8}
9