Example #1
0
func (k *KeyboardState) KeyDown(keycode int) bool {
	var b bool

	b = bool(C.al_key_down((*C.ALLEGRO_KEYBOARD_STATE)(k), C.int(keycode)))

	return b
}
Example #2
0
// Gets the state of a given keyboard key by keycode. True is down, false is up.
func KeyDown(keycode int) bool {
	state := &C.ALLEGRO_KEYBOARD_STATE{}
	C.al_get_keyboard_state(state)
	return bool(C.al_key_down(state, C.int(keycode)))
}
Example #3
0
func (k *KeyboardState) KeyDown(keycode int32) bool {
	return bool(C.al_key_down((*C.ALLEGRO_KEYBOARD_STATE)(unsafe.Pointer(k)), C.int(keycode)))
}