Exemplo n.º 1
0
func (m MouseState) GetButtons() []bool {
	var n int

	n = int(C.al_get_mouse_num_buttons())

	ms := (C.ALLEGRO_MOUSE_STATE)(m)
	slice := make([]bool, n)
	for i := uint(0); i < uint(n); i++ {
		button := (ms.buttons & (1 << i)) != 0
		slice[i] = button
	}
	return slice
}
Exemplo n.º 2
0
func GetMouseNumButtons() uint32 {
	return uint32(C.al_get_mouse_num_buttons())
}