-
-
Notifications
You must be signed in to change notification settings - Fork 492
TimotheeGreg edited this page Sep 7, 2023
·
32 revisions
key(code) -> is_pressed
key() -> is_any_pressed
-
code : the key code to check (1..65), see the table below or type
help keys
in console.
- pressed : a Boolean value which indicates whether or not the specified key is currently pressed.
- is_any_pressed : If no keycode is specified, returns a Boolean value indicating if any key is pressed.
Keycodes:
Letters | Digits | Characters | Edits | Directions | Modifiers |
---|---|---|---|---|---|
01 = A | 27 = 0 | 37 = MINUS | 50 = RETURN | 54 = PAGEUP | 62 = CAPSLOCK |
02 = B | 28 = 1 | 38 = EQUALS | 51 = BACKSPACE | 55 = PAGEDOWN | 63 = CTRL |
03 = C | 29 = 2 | 39 = LEFTBRACKET | 52 = DELETE | 56 = HOME | 64 = SHIFT |
04 = D | 30 = 3 | 40 = RIGHTBRACKET | 53 = INSERT | 57 = END | 65 = ALT |
05 = E | 31 = 4 | 41 = BACKSLASH | 58 = UP | ||
06 = F | 32 = 5 | 42 = SEMICOLON | 59 = DOWN | ||
07 = G | 33 = 6 | 43 = APOSTROPHE | 60 = LEFT | ||
08 = H | 34 = 7 | 44 = GRAVE | 61 = RIGHT | ||
09 = I | 35 = 8 | 45 = COMMA | |||
10 = J | 36 = 9 | 46 = PERIOD | |||
11 = K | 47 = SLASH | ||||
12 = L | 48 = SPACE | ||||
13 = M | 49 = TAB | ||||
14 = N | |||||
15 = O | |||||
16 = P | |||||
17 = Q | |||||
18 = R | |||||
19 = S | |||||
20 = T | |||||
21 = U | |||||
22 = V | |||||
23 = W | |||||
24 = X | |||||
25 = Y | |||||
26 = Z |
.-----------------------------------------------------------------------------------------. .----------------------.
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backsps | | Ins | Home | PgUp |
|-----------------------------------------------------------------------------------------| |----------------------|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | | Del | End | PgDn |
|-----------------------------------------------------------------------------------------| '----------------------'
| CapsLck | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|-----------------------------------------------------------------------------------------| .-------.
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | | Up |
|-----------------------------------------------------------------------------------------| .----------------------.
| Ctrl | Alt | | Alt | Ctrl | | Left | Down | Rght |
'-----------------------------------------------------------------------------------------' '----------------------'
The function returns true if the key denoted by keycode is pressed otherwise it returns false.
TIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
Platform
RAM & VRAM | Display | Palette | Bits per Pixel (BPP) |
.tic
Format | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
- BDR (0.90)
- BOOT (1.0)
- MENU
- OVR (deprecated)
- SCN (deprecated)
- TIC
- btn & btnp
- circ & circb
- clip
- cls
- elli & ellib (0.90)
- exit
- fget & fset (0.80)
- font
- key & keyp
- line
- map
- memcpy & memset
- mget & mset
- mouse
- music
- peek, peek4
- peek1, peek2 (1.0)
- pix
- pmem
- poke, poke4
- poke1, poke2 (1.0)
- rect & rectb
- reset
- sfx
- spr
- sync
- ttri (1.0)
- time
- trace
- tri & trib (0.90)
- tstamp (0.80)
- vbank (1.0)