gg: add is_key_down/1 helper method

This commit is contained in:
Delyan Angelov 2025-03-13 11:25:52 +02:00
parent 2fd3b7e881
commit 17695801ea
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

8
vlib/gg/keyboard.v Normal file
View File

@ -0,0 +1,8 @@
module gg
// is_key_down returns whether the given key is currently pressed.
// You can use this, if you do not want to implement your own key event handling.
@[inline]
pub fn (mut ctx Context) is_key_down(k KeyCode) bool {
return ctx.pressed_keys[int(k)]
}