Skip to main content

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.keyHuman namemacOS key code
aza – zVarious (0–6, 7–17, etc.)

Numbers

Browser e.keyHuman namemacOS key code
0029
1118
2219
3320
4421
5523
6622
7726
8828
9925

Symbols

Browser e.keyHuman namemacOS 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.keyHuman namemacOS key code
" " (space)space49
Enterreturn36
ArrowLeftleft arrow123
ArrowRightright arrow124
ArrowDowndown arrow125
ArrowUpup arrow126

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.keyHuman namemacOS key code
Shiftshift56
CapsLockcaps lock57
Backspacedelete51
Tabtab48
Metacommand55
Altoption58
Controlcontrol59
Escapeesc53

Function Keys

Browser e.keyHuman namemacOS key code
F1F1122
F2F2120
F3F399
F4F4118
F5F596
F6F697
F7F798
F8F8100
F9F9101
F10F10109
F11F11103
F12F12111
F13F13105
F14F14107
F15F15113
F16F16106
F17F1764
F18F1879
F19F1980
F20F2090
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 "~""`".

Build docs developers (and LLMs) love