Feature Overview
Buttons input
getbtns()
updates the extended button(key) input state.
- This must be done in the
_update()
function.
- Required
poke(0x5f2d,1)
- button values:
- btrg: returns true only for frames where a key was entered.
- butrg: returns true only for frames where a key was released.
- btns: returns true whenever the key is pressed.
- btnc: returns the count while the key is held.[number]
- _key: typed characters.[string]
- _ent: enter key typed.
- _del: delete/backspace key typed.
- modifier keys values:
- _ctr: ctrl/command key pressed.
- _alt: alt/opt key pressed.
- _sft: shift(left) key pressed.
- This function consumes 179 Token.
Example
Mouse input
'getmouse()' updates the mouse state.
- this must be done in the
_update()
function.
- Required
poke(0x5f2d,1)
- mouse values:
- _mo.x: Mouse X coordinate[number]
- _mo.y: Mouse Y coordinate[number]
- _mo.lt: returns true only for frames where the left-button was pressed.
- _mo.lu: returns true only for frames where the left-button was released.
- _mo.l: returns true whenever the left-button is pressed.
- _mo.ldb: returns true if the left-button is double-clicked.
- _mo.rt: returns true only for frames where the right-button was pressed.
- _mo.ru: returns true only for frames where the right-button was released.
- _mo.r: returns true whenever the right-button is pressed.
- _mo.rdb: returns true if the right-button is double-clicked.
- _mo.mt: returns true only for frames where the middle-button was pressed.
- _mo.mu: returns true only for frames where the middle-button was released.
- _mo.m: returns true whenever the middle-button is pressed.
- _mo.mdb: returns true if the middle-button is double-clicked.
- _mo.w: returns the mouse wheel input.[number]
- _mo.sx: returns the x coordinate where the drag started.[number]
- _mo.sy: returns the y coordinate where the drag started.[number]
- This function consumes 285 Token.
Example