keyboard_translatekeys3
Modify scancode mappings in raw keyboard mode
Usage
#include <vgakeyboard.h>
void keyboard_translatekeys(int mask);
Overview
This function sets several flags which control how certain scancodes are mapped. At startup a mask value of 0 is active.
mask must be a logical or of zero or more of the following #predefined integers to turn the features listed on:
TRANSLATE_CURSORKEYS-
Translate the scancodes of the
SCANCODE_CURSORBLOCK*keys to those of the cursor keys on the number pad, s.t. keyboard_getstate(3) and keyboard_keypressed(3) report a keypress of the corresponding number pad cursor key and not the one on the cursor block.
TRANSLATE_DIAGONAL-
Translates the scancodes of diagonal cursor keys (keypad 7, 9, 1, 3) to presses of two of the ordinary up, down, left, right keys. For example, instead of reporting a press of
SCANCODE_CURSORUPRIGHTkeyboard_getstate(3) and keyboard_keypressed(3) report a simultaneous press ofSCANCODE_CURSORUPandSCANCODE_CURSORRIGHT.
TRANSLATE_KEYPADENTER-
The scancode of the keypad enter key is mapped to that of the ordinary enter key, s.t. keyboard_getstate(3) and keyboard_keypressed(3) report a press of
SCANCODE_ENTERregardless if keypad enter or ordinary enter is pressed.
DONT_CATCH_CTRLC-
Pressing
<Ctrl>-Cdoesnotraise a SIGINT. On contrary to the other flags this has also effect when a user defined keyboard event handler is used. Svgalib willalwaysprocess<Alt>-F1-<Alt>-F10and perform console switches accordingly.
Releases
Unchanged in 5 releases since Debian 3.1 (Sarge).