Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tinkerer9/CollaboKeys/llms.txt
Use this file to discover all available pages before exploring further.
CollaboKeys can emulate a broad range of keys — letters, numbers, symbols, arrow keys, modifier keys, and function keys F1 through F20. Not all of them are active out of the box, however. Each key in keycodes.js carries an enabled flag that controls whether players are allowed to claim and press it. Most everyday keys are enabled by default; modifier keys and function keys are disabled by default to prevent players from accidentally triggering system shortcuts or browser hotkeys.
Enabled by Default
The following keys are available to players without any configuration change.
Letters
All 26 lowercase letters are enabled. The alias.js originalKey() function automatically maps uppercase variants (e.g. "A") back to their lowercase base key ("a"), so Caps Lock state on the player’s device does not matter.
Browser e.key | Human name | macOS key code |
|---|
a – z | a – z | Various (0–6, 7–17, etc.) |
Numbers
Browser e.key | Human name | macOS key code |
|---|
0 | 0 | 29 |
1 | 1 | 18 |
2 | 2 | 19 |
3 | 3 | 20 |
4 | 4 | 21 |
5 | 5 | 23 |
6 | 6 | 22 |
7 | 7 | 26 |
8 | 8 | 28 |
9 | 9 | 25 |
Symbols
Browser e.key | Human name | macOS key code |
|---|
- | - | 27 |
= | = | 24 |
[ | [ | 33 |
] | ] | 30 |
\ | \ | 42 |
; | ; | 41 |
' | ’ | 39 |
, | , | 43 |
. | . | 47 |
/ | / | 44 |
` | ` | 50 |
Shifted symbol variants such as !, @, #, _, +, {, }, |, :, ", <, >, ?, and ~ are also handled via alias.js. They are mapped back to their unshifted base key before being sent to the server, so pressing Shift+1 is treated the same as pressing 1.
Special and Navigation Keys
Browser e.key | Human name | macOS key code |
|---|
" " (space) | space | 49 |
Enter | return | 36 |
ArrowLeft | left arrow | 123 |
ArrowRight | right arrow | 124 |
ArrowDown | down arrow | 125 |
ArrowUp | up arrow | 126 |
Disabled by Default
The following keys exist in keycodes.js but have their enabled flag set to false. Players will see "<keyname> is disabled by admin." if they try to press them.
Modifier Keys
Browser e.key | Human name | macOS key code |
|---|
Shift | shift | 56 |
CapsLock | caps lock | 57 |
Backspace | delete | 51 |
Tab | tab | 48 |
Meta | command | 55 |
Alt | option | 58 |
Control | control | 59 |
Escape | esc | 53 |
Function Keys
Browser e.key | Human name | macOS key code |
|---|
F1 | F1 | 122 |
F2 | F2 | 120 |
F3 | F3 | 99 |
F4 | F4 | 118 |
F5 | F5 | 96 |
F6 | F6 | 97 |
F7 | F7 | 98 |
F8 | F8 | 100 |
F9 | F9 | 101 |
F10 | F10 | 109 |
F11 | F11 | 103 |
F12 | F12 | 111 |
F13 | F13 | 105 |
F14 | F14 | 107 |
F15 | F15 | 113 |
F16 | F16 | 106 |
F17 | F17 | 64 |
F18 | F18 | 79 |
F19 | F19 | 80 |
F20 | F20 | 90 |
F13–F20 are not present on standard keyboard layouts. They exist in keycodes.js for completeness but are unlikely to be needed in practice.
Enabling Disabled Keys
An admin can enable any disabled key — or all keys at once — using the key enable command. This works from both the terminal console and the admin page command box.
# Enable a single key
key enable Shift
# Enable all keys at once
key enable all
# Disable a key again
key disable Escape
You can also revoke a key’s current player assignment without changing its enabled status:
key revoke ArrowLeft
key revoke all
Enable modifier keys only when your game specifically needs them. Keys like Meta (Command) and Escape can interfere with macOS system shortcuts and browser behaviour if players press them unexpectedly.
The /keycodes Endpoint
Visiting http://<host-ip>:<port>/keycodes in any browser returns a plain-text table of every key in keycodes.js with three columns: Key, Enabled, and Player ID (the name and ID of the player currently assigned to that key, or – if unassigned). This is useful for the admin to see the live state of all keys at a glance.
The same table can also be printed to the terminal by running the keycodes command, or by clicking the List Keycodes button on the admin page.
Key Names and Browser e.key Values
CollaboKeys uses the JavaScript e.key property values that the browser reports on keydown and keyup events. These are the exact strings that script.js passes to socket.emit('keydown', ...). The most important non-obvious values are:
- Space is
" " (a single space character), not the string "Space" or "space"
- Enter is
"Enter", not "Return"
- Arrow keys are
"ArrowLeft", "ArrowRight", "ArrowDown", "ArrowUp" — not "Left", "Right", etc.
- Backspace is
"Backspace" (the browser key name), mapped to "delete" (the macOS name) in keycodes.js
- Windows/Meta key is
"Meta", mapped to "command" on macOS
- Alt/Option is
"Alt", mapped to "option" on macOS
Before any key name reaches the server, alias.js’s originalKey() function remaps shifted variants to their base keys. For example, "A" → "a", "!" → "1", "_" → "-", and "~" → "`".