This documentation is outdated and is to be rewritten under the new system specifications. Do not rely on this information.
Basic text input on the Mark 1 is accomplished through the keyboard. The BIOS has some general system calls for basic functionality of the computer.
The BIOS has no input calls for input devices.
Output BIOS calls for input devices are created in the keyboard with the _peripheral-keyboard
script and forwarded directly through the BIOS peripheral bus.
Output Message String | Integer | Key | LE-BIOS rev. | Script |
---|---|---|---|---|
BIOS_CONTROL_INPUT |
(n/a) | [key_change] |
1000 | _peripheral-keyboard in keyboard via _bios-peripherals |
Signals a change in a control key. [key_change]
is formatted as KEY_ACTION
, where KEY
is a valid control key and ACTION
is either PUSH
or RELEASE
. Valid control keys are listed below (which does not include the Ctrl key). For example, pushing and releasing the up arrow key will send UP_PUSH
then UP_RELEASE
.
Most programs need not listen for both the PUSH
and RELEASE
commands; one or the other is usually sufficient. However, if you wish to use the ability to hold one of the keys to do something, you will need to listen to both. It is recommended that you use a timeout of some kind before you consider a key held down so that key taps are not considered held keys, although whether you do so is up to you.
Note that the control keys are not labeled the same as LSL; instead, they are as follows:
UP
: up arrow (CONTROL_FWD
in LSL)DOWN
: down arrow (CONTROL_BACK
in LSL)LEFT
: left arrow (CONTROL_LEFT
and CONTROL_ROT_LEFT
in LSL)RIGHT
: right arrow (CONTROL_RIGHT
and CONTROL_ROT_RIGHT
in LSL)PGUP
: Page Up (CONTROL_UP
in LSL)PGDN
: Page Down (CONTROL_DOWN
in LSL)So, for example, pushing the left arrow key in any case will send LEFT_PUSH
, and releasing Page Down will send PGDN_RELEASE
.
BIOS_CONTROL_INPUT
will only trigger for the above keys. Despite the name, it will not trigger with the Ctrl key. All other keys will send BIOS_KEY_INPUT
, which will only be sent when the key is pressed, not released. Therefore, for functions that require knowing when the key is held down, programs should only use the above keys.
BIOS_CONTROL_INPUT
can be triggered by either using your real-life keyboard keys while your control permission is granted or by clicking the keys on the keyboard. Clicking the keys on the keyboard will still trigger PUSH
and RELEASE
states as if done by a real-life keyboard.
It is not possible to listen for the edge and level values typically used in LSL's control event.
Output Message String | Integer | Key | LE-BIOS rev. | Script |
---|---|---|---|---|
BIOS_KEY_INPUT |
(n/a) | [key_names] |
1000 | _peripheral-keyboard in keyboard via _bios-peripherals |
Sent when the keyboard receives a one or more keystrokes other than a valid control key that would trigger BIOS_CONTROL_INPUT
and other than the system management keys on the upper right (Get Disp, Sys Cfg, and Make User). A keystroke can be performed by either clicking the key on the keyboard, pushing a key on your real-life keyboard that is bound to a Mark 1 keyboard passthrough gesture, or by sending a single character in chat (you cannot send a multi-character key through chat).
The [key_names]
value is formatted as a | (pipe) delineated list. It is possible to receive multiple keystrokes in a single call, such as the phrase "HELLO", which would result in a value of H|E|L|L|O
. A | (pipe) character is sent as blank; for example, the text "AB|CD" would be sent as A|B||C|D
. The following description applies to each keystroke individually.
All keys shown on the Mark 1 keyboard, except for the arrow keys, Page Up, Page Down, Get Disp, Sys Cfg, Make User, and the Shift/Ctrl/Alt-modified versions of those keys, trigger BIOS_KEY_INPUT
. However, due to limitations in gesture key binding, certain gesture-bound keys will be overridden by the viewer and cannot pass through to the Mark 1 in-world.
For single-character keys (alphanumeric and special characters), the key will be sent as a single character. Thus, for text input, it is safe to assume that single-character keys can be input as raw text. For multi-character keys, such as Tab, Backspace, and F-keys, the keyboard will send the key's full name fully capitalized. For example, Backspace will be sent as BACKSPACE
, and F4 will be sent as F4
. Note that some keys on the keyboard are abbreviated, but the keyboard will send their full name; namely, Ins will be sent as INSERT
, and Del will be sent as DELETE
. For multi-character keys, they should not be entered directly as raw text; instead, they should be captured and used for text modification or other functions.
For space, the key will be sent as a literal space: " "
without quotes, not as the word "space".
For alpha keys, when the Shift key is held or the Caps Lock key is enabled, the character will be capitalized.
For keys with a Shift-modified special character (numrow and special characters in the main area), the Shift-modified special character will be sent only if the Shift key is held. For example, the keyboard will send /
when the / key is pressed, but will send ?
when the / key is pressed while the Shift key is held.
For keys without a Shift-modified special character, the keyboard will send SHIFT+[character]
. For example, if the F5 key is pressed while Shift is held, the keyboard will send SHIFT+F5
.
All keys can modified by the Ctrl, Alt, and Shift keys. Multiple modifier keys can be used at the same time, although this can only be done with the in-world keyboard. This will append CTRL+
, ALT+
, and SHIFT+
to the front of the key, in that order. For example, holding Ctrl and Alt while pressing Del will send CTRL+ALT+DELETE
(though it should be noted that this will obviously not work as a passthrough key combination). Holding Ctrl, Alt, and Shift while pressing F1 would send CTRL+ALT+SHIFT+F1
. When a modifier key is used on the in-world keyboard, it is automatically released when a non-modifier key is pressed.
Note that the | (pipe) key, which requires holding Shift + \, is treated as blank for modifier keys. For example, holding Ctrl + Shift + </kbd> will simply generate CTRL+
.
The Caps Lock key will only capitalize alpha keys; it will not act as a shift and will not append anything to the sent key. Unlike Shift, however, the Caps Lock key will not be released until you click it again (or press Caps Lock in real life). The Caps Lock key cannot be modified.
The Ctrl, Alt, Shift, and Caps Lock keys will send their state when engaged or manually disengaged on the in-world keyboard. However, they will not send their state when automatically disengaged by pressing a non-modifier key. The BIOS_KEY_INPUT
command will be sent with [key]_[state]
, where [key]
is CTRL
, ALT
, or SHIFT
, and [state]
is either 0 or 1. For example, when the Alt key is clicked and engaged on the in-world keyboard, it will send ALT_1
. When the Alt key is clicked and disengaged, it will send ALT_0
. However, if the Alt key is disengaged by pressing another key, such as pressing F1 when Alt is held, the keyboard will send ALT+F1
, but it will not send ALT_0
. The Caps Lock key will also do so for your real-life keyboard, but the other modifier keys will not because of gesture limitations. Note that these messages are not modified, so pressing Alt while Shift is engaged will only send ALT_1
, not SHIFT+ALT_1
.
It is only possible to detect when the above keys are pressed, not released.