buttons

Stack effect: ( -- n )

Put the state of several buttons on the stack.

Unique to Haiku Forth. Returns an integer number. Each button is represented by 1 bit position in the integer. There are an unspecified number of buttons. One current implementation provides 23 buttons.

Mouse clicks and single or double touch on touch devices go button 0. Keyboard is also attached at: Q (also mouse + touch) -> 0 A -> 1 W -> 2 S -> 3 E -> 4 D -> 5 R -> 6 F -> 7 C -> 8 V -> 9 H -> 10 N -> 11 M -> 12 U -> 13 J -> 14 I -> 15K -> 16 O -> 17 L -> 18 P -> 19 ; -> 20 [ -> 21 ' -> 22

NOTE: In Haiku Forth (unlike Traditional Forth), all stack cells and memory locations are floating point numbers.

Forth Haiku Glossary