button

Stack effect: ( n -- n )

Put the state of a given button on the stack.

Unique to Haiku Forth. Returns an integer number. 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