Ps2KeyboardHost  1.0.1
Allows you to read from one or more PS2-style keyboards on an Arduino.
ps2 Namespace Reference

Classes

class  AnsiTranslator
 This class provides a translation from PS2 incoming scancodes to Ansi. Right now, the name "Ansi" is aspirational, as the implementation given here only works for English keyboards. More...
 
class  Keyboard
 Instances of this class can be used to interface with a PS2 keyboard. This class does not decode the keystroke protocol, but rather provides the data from the keyboard in a raw form. You either need to write code that directly understands what the PS2 is providing, or use one of the provided translator classes (e.g. AnsiTranslator). More...
 
class  NeutralTranslator
 A translation from PS2 default ScanCode Set to a neutral format. More...
 
class  NullDiagnostics
 This is the default class for diagnostic information for all the classes in this library. It's the class you want if want to drop diagnostic information on the floor (because, say, your device works plenty reliably and there's nothing to debug anymore). If you're not in that blessed place, then you can create your own class that implements all these methods and stashes the data somewhere. More...
 
class  SimpleDiagnostics
 A basic recorder for events coming from the PS2 keyboard class library. More...
 
struct  UsbKeyAction
 A translated PS2 keystroke - it indicates either a keydown, a key up, or that there should be no immediate action. More...
 
class  UsbTranslator
 Translates from PS2's default scancode set to USB/HID. More...
 

Enumerations

enum  KeyboardLeds {
  KeyboardLeds::capsLock = 0x4, KeyboardLeds::numLock = 0x2, KeyboardLeds::scrollLock = 0x1, KeyboardLeds::all = 0x7,
  KeyboardLeds::none = 0x0
}
 The LED's available on a standard PS2 keyboard. More...
 
enum  KeyboardOutput : uint8_t {
  KeyboardOutput::none = 0x0, KeyboardOutput::garbled = 0xfe, KeyboardOutput::batSuccessful = 0xaa, KeyboardOutput::batFailure = 0xfc,
  KeyboardOutput::ack = 0xfa, KeyboardOutput::echo = 0xee, KeyboardOutput::nack = 0xfe, KeyboardOutput::unmake = 0xf0,
  KeyboardOutput::extend = 0xe0, KeyboardOutput::extend1 = 0xe1, KeyboardOutput::sc2_numLock = 0x77, KeyboardOutput::sc2_scrollLock = 0x7e,
  KeyboardOutput::sc2_capsLock = 0x58, KeyboardOutput::sc2_leftShift = 0x12, KeyboardOutput::sc2_rightShift = 0x59, KeyboardOutput::sc2_leftCtrl = 0x14,
  KeyboardOutput::sc2_leftAlt = 0x11, KeyboardOutput::sc2_sysRequest = 0x84, KeyboardOutput::sc2_esc = 0x76, KeyboardOutput::sc2_backspace = 0x66,
  KeyboardOutput::sc2_tab = 0x0d, KeyboardOutput::sc2_enter = 0x5a, KeyboardOutput::sc2_space = 0x29, KeyboardOutput::sc2_keypad0 = 0x70,
  KeyboardOutput::sc2_keypad1 = 0x69, KeyboardOutput::sc2_keypad2 = 0x72, KeyboardOutput::sc2_keypad3 = 0x7a, KeyboardOutput::sc2_keypad4 = 0x6b,
  KeyboardOutput::sc2_keypad5 = 0x73, KeyboardOutput::sc2_keypad6 = 0x74, KeyboardOutput::sc2_keypad7 = 0x6c, KeyboardOutput::sc2_keypad8 = 0x75,
  KeyboardOutput::sc2_keypad9 = 0x7d, KeyboardOutput::sc2_keypadPeriod = 0x71, KeyboardOutput::sc2_keypadPlus = 0x79, KeyboardOutput::sc2_keypadDash = 0x7b,
  KeyboardOutput::sc2_keypadAsterisk = 0x7c, KeyboardOutput::sc2ex_keypadEnter = 0x5a, KeyboardOutput::sc2_KeypadEquals = 0x0f, KeyboardOutput::sc2_keypadComma = 0x6d,
  KeyboardOutput::sc2ex_keypadForwardSlash = 0x4a, KeyboardOutput::sc2_0 = 0x45, KeyboardOutput::sc2_1 = 0x16, KeyboardOutput::sc2_2 = 0x1e,
  KeyboardOutput::sc2_3 = 0x26, KeyboardOutput::sc2_4 = 0x25, KeyboardOutput::sc2_5 = 0x2e, KeyboardOutput::sc2_6 = 0x36,
  KeyboardOutput::sc2_7 = 0x3d, KeyboardOutput::sc2_8 = 0x3e, KeyboardOutput::sc2_9 = 0x46, KeyboardOutput::sc2_apostrophe = 0x52,
  KeyboardOutput::sc2_comma = 0x41, KeyboardOutput::sc2_dash = 0x4e, KeyboardOutput::sc2_period = 0x49, KeyboardOutput::sc2_forwardSlash = 0x4a,
  KeyboardOutput::sc2_openQuote = 0x0e, KeyboardOutput::sc2_a = 0x1c, KeyboardOutput::sc2_b = 0x32, KeyboardOutput::sc2_c = 0x21,
  KeyboardOutput::sc2_d = 0x23, KeyboardOutput::sc2_e = 0x24, KeyboardOutput::sc2_f = 0x2b, KeyboardOutput::sc2_g = 0x34,
  KeyboardOutput::sc2_h = 0x33, KeyboardOutput::sc2_i = 0x43, KeyboardOutput::sc2_j = 0x3b, KeyboardOutput::sc2_k = 0x42,
  KeyboardOutput::sc2_l = 0x4b, KeyboardOutput::sc2_m = 0x3a, KeyboardOutput::sc2_n = 0x31, KeyboardOutput::sc2_o = 0x44,
  KeyboardOutput::sc2_p = 0x4d, KeyboardOutput::sc2_q = 0x15, KeyboardOutput::sc2_r = 0x2d, KeyboardOutput::sc2_s = 0x1b,
  KeyboardOutput::sc2_t = 0x2c, KeyboardOutput::sc2_u = 0x3c, KeyboardOutput::sc2_v = 0x2a, KeyboardOutput::sc2_w = 0x1d,
  KeyboardOutput::sc2_x = 0x22, KeyboardOutput::sc2_y = 0x35, KeyboardOutput::sc2_z = 0x1a, KeyboardOutput::sc2_semicolon = 0x4c,
  KeyboardOutput::sc2_backslash = 0x5d, KeyboardOutput::sc2_europe2 = 0x61, KeyboardOutput::sc2_openSquareBracket = 0x54, KeyboardOutput::sc2_closeSquareBracket = 0x5b,
  KeyboardOutput::sc2_equal = 0x55, KeyboardOutput::sc2_f1 = 0x05, KeyboardOutput::sc2_f2 = 0x06, KeyboardOutput::sc2_f3 = 0x04,
  KeyboardOutput::sc2_f4 = 0x0c, KeyboardOutput::sc2_f5 = 0x03, KeyboardOutput::sc2_f6 = 0x0b, KeyboardOutput::sc2_f7 = 0x83,
  KeyboardOutput::sc2_f8 = 0x0a, KeyboardOutput::sc2_f9 = 0x01, KeyboardOutput::sc2_f10 = 0x09, KeyboardOutput::sc2_f11 = 0x78,
  KeyboardOutput::sc2_f12 = 0x07, KeyboardOutput::sc2_f13 = 0x08, KeyboardOutput::sc2_f14 = 0x10, KeyboardOutput::sc2_f15 = 0x18,
  KeyboardOutput::sc2_f16 = 0x20, KeyboardOutput::sc2_f17 = 0x28, KeyboardOutput::sc2_f18 = 0x30, KeyboardOutput::sc2_f19 = 0x38,
  KeyboardOutput::sc2_f20 = 0x40, KeyboardOutput::sc2_f21 = 0x48, KeyboardOutput::sc2_f22 = 0x50, KeyboardOutput::sc2_f23 = 0x57,
  KeyboardOutput::sc2_f24 = 0x5f, KeyboardOutput::sc2_intl1 = 0x51, KeyboardOutput::sc2_intl2 = 0x13, KeyboardOutput::sc2_intl3 = 0x6a,
  KeyboardOutput::sc2_intl4 = 0x64, KeyboardOutput::sc2_intl5 = 0x67, KeyboardOutput::sc2_lang1 = 0xF2, KeyboardOutput::sc2_lang2 = 0xF1,
  KeyboardOutput::sc2_lang3 = 0x63, KeyboardOutput::sc2_lang4 = 0x62, KeyboardOutput::sc2_lang5 = 0x5f, KeyboardOutput::sc2ex_pauseBreak = 0x5f,
  KeyboardOutput::sc2ex_rightCtrl = 0x14, KeyboardOutput::sc2ex_rightAlt = 0x11, KeyboardOutput::sc2ex_leftGui = 0x1f, KeyboardOutput::sc2ex_leftWindows = 0x1f,
  KeyboardOutput::sc2ex_rightGui = 0x27, KeyboardOutput::sc2ex_rightWindows = 0x27, KeyboardOutput::sc2ex_printScreen = 0x7c, KeyboardOutput::sc2ex_menu = 0x2f,
  KeyboardOutput::sc2ex_home = 0x6c, KeyboardOutput::sc2ex_end = 0x69, KeyboardOutput::sc2ex_pageUp = 0x7d, KeyboardOutput::sc2ex_pageDown = 0x7a,
  KeyboardOutput::sc2ex_leftArrow = 0x6b, KeyboardOutput::sc2ex_rightArrow = 0x74, KeyboardOutput::sc2ex_upArrow = 0x75, KeyboardOutput::sc2ex_downArrow = 0x72,
  KeyboardOutput::sc2ex_insert = 0x70, KeyboardOutput::sc2ex_delete = 0x71, KeyboardOutput::sc2ex_nextTrack = 0x4d, KeyboardOutput::sc2ex_prevTrack = 0x15,
  KeyboardOutput::sc2ex_stop = 0x3b, KeyboardOutput::sc2ex_play = 0x34, KeyboardOutput::sc2ex_mute = 0x23, KeyboardOutput::sc2ex_volumeUp = 0x32,
  KeyboardOutput::sc2ex_volumeDown = 0x21, KeyboardOutput::sc2ex_mediaSelect = 0x50, KeyboardOutput::sc2ex_email = 0x48, KeyboardOutput::sc2ex_calculator = 0x2b,
  KeyboardOutput::sc2ex_myComputer = 0x40, KeyboardOutput::sc2ex_webSearch = 0x10, KeyboardOutput::sc2ex_webHome = 0x3a, KeyboardOutput::sc2ex_webBack = 0x38,
  KeyboardOutput::sc2ex_webForward = 0x30, KeyboardOutput::sc2ex_webStop = 0x28, KeyboardOutput::sc2ex_webRefresh = 0x20, KeyboardOutput::sc2ex_webFavorites = 0x18,
  KeyboardOutput::sc2ex_power = 0x37, KeyboardOutput::sc2ex_sleep = 0x3f, KeyboardOutput::sc2ex_wake = 0X5e, KeyboardOutput::sc3_a = 0x1c,
  KeyboardOutput::sc3_b = 0x32, KeyboardOutput::sc3_c = 0x21, KeyboardOutput::sc3_d = 0x23, KeyboardOutput::sc3_e = 0x24,
  KeyboardOutput::sc3_f = 0x2b, KeyboardOutput::sc3_g = 0x34, KeyboardOutput::sc3_h = 0x33, KeyboardOutput::sc3_i = 0x43,
  KeyboardOutput::sc3_j = 0x3b, KeyboardOutput::sc3_k = 0x42, KeyboardOutput::sc3_l = 0x4b, KeyboardOutput::sc3_m = 0x3a,
  KeyboardOutput::sc3_n = 0x31, KeyboardOutput::sc3_o = 0x44, KeyboardOutput::sc3_p = 0x4d, KeyboardOutput::sc3_q = 0x15,
  KeyboardOutput::sc3_r = 0x2d, KeyboardOutput::sc3_s = 0x1b, KeyboardOutput::sc3_t = 0x2c, KeyboardOutput::sc3_u = 0x3c,
  KeyboardOutput::sc3_v = 0x2a, KeyboardOutput::sc3_w = 0x1d, KeyboardOutput::sc3_x = 0x22, KeyboardOutput::sc3_y = 0x35,
  KeyboardOutput::sc3_z = 0x1a, KeyboardOutput::sc3_0 = 0x45, KeyboardOutput::sc3_1 = 0x16, KeyboardOutput::sc3_2 = 0x1e,
  KeyboardOutput::sc3_3 = 0x26, KeyboardOutput::sc3_4 = 0x25, KeyboardOutput::sc3_5 = 0x2e, KeyboardOutput::sc3_6 = 0x36,
  KeyboardOutput::sc3_7 = 0x3d, KeyboardOutput::sc3_8 = 0x3e, KeyboardOutput::sc3_9 = 0x46, KeyboardOutput::sc3_keypadSlash = 0x4a,
  KeyboardOutput::sc3_keypadAsterisk = 0x7e, KeyboardOutput::sc3_keypadDash = 0x4e, KeyboardOutput::sc3_keypadPlus = 0x7c, KeyboardOutput::sc3_keypadEnter = 0x79,
  KeyboardOutput::sc3_keypadPeriod = 0x71, KeyboardOutput::sc3_keypad0 = 0x70, KeyboardOutput::sc3_keypad1 = 0x69, KeyboardOutput::sc3_keypad2 = 0x72,
  KeyboardOutput::sc3_keypad3 = 0x7a, KeyboardOutput::sc3_keypad4 = 0x6b, KeyboardOutput::sc3_keypad5 = 0x73, KeyboardOutput::sc3_keypad6 = 0x74,
  KeyboardOutput::sc3_keypad7 = 0x6c, KeyboardOutput::sc3_keypad8 = 0x75, KeyboardOutput::sc3_keypad9 = 0x7d, KeyboardOutput::sc3_f1 = 0x07,
  KeyboardOutput::sc3_f2 = 0x0f, KeyboardOutput::sc3_f3 = 0x17, KeyboardOutput::sc3_f4 = 0x1f, KeyboardOutput::sc3_f5 = 0x27,
  KeyboardOutput::sc3_f6 = 0x2f, KeyboardOutput::sc3_f7 = 0x37, KeyboardOutput::sc3_f8 = 0x3f, KeyboardOutput::sc3_f9 = 0x47,
  KeyboardOutput::sc3_f10 = 0x4f, KeyboardOutput::sc3_f11 = 0x56, KeyboardOutput::sc3_f12 = 0x5e, KeyboardOutput::sc3_openSquareBracket = 0x54,
  KeyboardOutput::sc3_openQuote = 0x0e, KeyboardOutput::sc3_dash = 0x4e, KeyboardOutput::sc3_insert = 0x67, KeyboardOutput::sc3_home = 0x6e,
  KeyboardOutput::sc3_pageUp = 0x6f, KeyboardOutput::sc3_delete = 0x64, KeyboardOutput::sc3_end = 0x65, KeyboardOutput::sc3_pageDown = 0x6d,
  KeyboardOutput::sc3_upArrow = 0x63, KeyboardOutput::sc3_leftArrow = 0x61, KeyboardOutput::sc3_downArrow = 0x60, KeyboardOutput::sc3_rightArrow = 0x6a,
  KeyboardOutput::sc3_numLock = 0x76, KeyboardOutput::sc3_capsLock = 0x14, KeyboardOutput::sc3_leftShift = 0x12, KeyboardOutput::sc3_leftCtrl = 0x11,
  KeyboardOutput::sc3_leftGui = 0x8b, KeyboardOutput::sc3_leftWindows = 0x8b, KeyboardOutput::sc3_leftAlt = 0x19, KeyboardOutput::sc3_rightShift = 0x59,
  KeyboardOutput::sc3_rightCtrl = 0x58, KeyboardOutput::sc3_rightGui = 0x8c, KeyboardOutput::sc3_rightWindows = 0x8c, KeyboardOutput::sc3_rightAlt = 0x39,
  KeyboardOutput::sc3_backspace = 0x66, KeyboardOutput::sc3_tab = 0x0d, KeyboardOutput::sc3_space = 0x29, KeyboardOutput::sc3_enter = 0x5a,
  KeyboardOutput::sc3_equal = 0x55, KeyboardOutput::sc3_backslash = 0x5c, KeyboardOutput::sc3_escape = 0x08, KeyboardOutput::sc3_closeSquareBracket = 0x5b,
  KeyboardOutput::sc3_semicolon = 0x4c, KeyboardOutput::sc3_apostrophe = 0x52, KeyboardOutput::sc3_comma = 0x41, KeyboardOutput::sc3_period = 0x49,
  KeyboardOutput::sc3_slash = 0x4a, KeyboardOutput::sc3_printScreen = 0x57, KeyboardOutput::sc3_scrollLock = 0x5f, KeyboardOutput::sc3_pause = 0x62,
  KeyboardOutput::sc3_apps = 0x8d, KeyboardOutput::sc3_menu = 0x8d
}
 Byte-codes sent back from the Ps2 keyboard to the host. More...
 
enum  KeyCode : uint16_t {
  PS2_NONE = 0x0, PS2_SHIFT = 0x4000, PS2_CTRL = 0x2000, PS2_ALT = 0x800,
  PS2_GUI = 0x200, PS2_MODIFIERS = 0xff00, PS2_KEY_NUM = 0x01, PS2_KEY_SCROLL = 0x02,
  PS2_KEY_CAPS = 0x03, PS2_KEY_PRTSCR = 0x04, PS2_KEY_PAUSE = 0x05, PS2_KEY_L_SHIFT = 0x06,
  PS2_KEY_R_SHIFT = 0x07, PS2_KEY_L_CTRL = 0x08, PS2_KEY_R_CTRL = 0x09, PS2_KEY_L_ALT = 0x0A,
  PS2_KEY_R_ALT = 0x0B, PS2_KEY_L_GUI = 0x0C, PS2_KEY_R_GUI = 0x0D, PS2_KEY_MENU = 0x0E,
  PS2_KEY_BREAK = 0x0F, PS2_KEY_SYSRQ = 0x10, PS2_KEY_HOME = 0x11, PS2_KEY_END = 0x12,
  PS2_KEY_PGUP = 0x13, PS2_KEY_PGDN = 0x14, PS2_KEY_L_ARROW = 0x15, PS2_KEY_R_ARROW = 0x16,
  PS2_KEY_UP_ARROW = 0x17, PS2_KEY_DN_ARROW = 0x18, PS2_KEY_INSERT = 0x19, PS2_KEY_DELETE = 0x1A,
  PS2_KEY_ESC = 0x1B, PS2_KEY_BS = 0x1C, PS2_KEY_TAB = 0x1D, PS2_KEY_ENTER = 0x1E,
  PS2_KEY_SPACE = 0x1F, PS2_KEY_KP0 = 0x20, PS2_KEY_KP1 = 0x21, PS2_KEY_KP2 = 0x22,
  PS2_KEY_KP3 = 0x23, PS2_KEY_KP4 = 0x24, PS2_KEY_KP5 = 0x25, PS2_KEY_KP6 = 0x26,
  PS2_KEY_KP7 = 0x27, PS2_KEY_KP8 = 0x28, PS2_KEY_KP9 = 0x29, PS2_KEY_KP_DOT = 0x2A,
  PS2_KEY_KP_ENTER = 0x2B, PS2_KEY_KP_PLUS = 0x2C, PS2_KEY_KP_MINUS = 0x2D, PS2_KEY_KP_TIMES = 0x2E,
  PS2_KEY_KP_DIV = 0x2F, PS2_KEY_0 = 0x30, PS2_KEY_1 = 0x31, PS2_KEY_2 = 0x32,
  PS2_KEY_3 = 0x33, PS2_KEY_4 = 0x34, PS2_KEY_5 = 0x35, PS2_KEY_6 = 0x36,
  PS2_KEY_7 = 0x37, PS2_KEY_8 = 0x38, PS2_KEY_9 = 0x39, PS2_KEY_APOS = 0x3A,
  PS2_KEY_COMMA = 0x3B, PS2_KEY_MINUS = 0x3C, PS2_KEY_DOT = 0x3D, PS2_KEY_DIV = 0x3E,
  PS2_KEY_KP_EQUAL = 0x3F, PS2_KEY_SINGLE = 0x40, PS2_KEY_A = 0x41, PS2_KEY_B = 0x42,
  PS2_KEY_C = 0x43, PS2_KEY_D = 0x44, PS2_KEY_E = 0x45, PS2_KEY_F = 0x46,
  PS2_KEY_G = 0x47, PS2_KEY_H = 0x48, PS2_KEY_I = 0x49, PS2_KEY_J = 0x4A,
  PS2_KEY_K = 0x4B, PS2_KEY_L = 0x4C, PS2_KEY_M = 0x4D, PS2_KEY_N = 0x4E,
  PS2_KEY_O = 0x4F, PS2_KEY_P = 0x50, PS2_KEY_Q = 0x51, PS2_KEY_R = 0x52,
  PS2_KEY_S = 0x53, PS2_KEY_T = 0x54, PS2_KEY_U = 0x55, PS2_KEY_V = 0x56,
  PS2_KEY_W = 0x57, PS2_KEY_X = 0x58, PS2_KEY_Y = 0x59, PS2_KEY_Z = 0x5A,
  PS2_KEY_SEMI = 0x5B, PS2_KEY_BACK = 0x5C, PS2_KEY_OPEN_SQ = 0x5D, PS2_KEY_CLOSE_SQ = 0x5E,
  PS2_KEY_EQUAL = 0x5F, PS2_KEY_KP_COMMA = 0x60, PS2_KEY_F1 = 0x61, PS2_KEY_F2 = 0x62,
  PS2_KEY_F3 = 0x63, PS2_KEY_F4 = 0x64, PS2_KEY_F5 = 0x65, PS2_KEY_F6 = 0x66,
  PS2_KEY_F7 = 0x67, PS2_KEY_F8 = 0x68, PS2_KEY_F9 = 0x69, PS2_KEY_F10 = 0x6A,
  PS2_KEY_F11 = 0x6B, PS2_KEY_F12 = 0x6C, PS2_KEY_F13 = 0x6D, PS2_KEY_F14 = 0x6E,
  PS2_KEY_F15 = 0x6F, PS2_KEY_F16 = 0x70, PS2_KEY_F17 = 0x71, PS2_KEY_F18 = 0x72,
  PS2_KEY_F19 = 0x73, PS2_KEY_F20 = 0x74, PS2_KEY_F21 = 0x75, PS2_KEY_F22 = 0x76,
  PS2_KEY_F23 = 0x77, PS2_KEY_F24 = 0x78, PS2_KEY_NEXT_TR = 0x79, PS2_KEY_PREV_TR = 0x7A,
  PS2_KEY_STOP = 0x7B, PS2_KEY_PLAY = 0x7C, PS2_KEY_MUTE = 0x7D, PS2_KEY_VOL_UP = 0x7E,
  PS2_KEY_VOL_DN = 0x7F, PS2_KEY_MEDIA = 0x80, PS2_KEY_EMAIL = 0x81, PS2_KEY_CALC = 0x82,
  PS2_KEY_COMPUTER = 0x83, PS2_KEY_WEB_SEARCH = 0x84, PS2_KEY_WEB_HOME = 0x85, PS2_KEY_WEB_BACK = 0x86,
  PS2_KEY_WEB_FORWARD = 0x87, PS2_KEY_WEB_STOP = 0x88, PS2_KEY_WEB_REFRESH = 0x89, PS2_KEY_WEB_FAVOR = 0x8A,
  PS2_KEY_EUROPE2 = 0x8B, PS2_KEY_POWER = 0x8C, PS2_KEY_SLEEP = 0x8D, PS2_KEY_WAKE = 0x90,
  PS2_KEY_INTL1 = 0x91, PS2_KEY_INTL2 = 0x92, PS2_KEY_INTL3 = 0x93, PS2_KEY_INTL4 = 0x94,
  PS2_KEY_INTL5 = 0x95, PS2_KEY_LANG1 = 0x96, PS2_KEY_LANG2 = 0x97, PS2_KEY_LANG3 = 0x98,
  PS2_KEY_LANG4 = 0x99, PS2_KEY_LANG5 = 0xA0
}
 
enum  Parity : uint8_t { Parity::odd = 0, Parity::even = 1 }
 
enum  ScanCodeSet : uint8_t {
  ScanCodeSet::defaultScanCodeSet = 2, ScanCodeSet::pcxt = 1, ScanCodeSet::pcat = 2, ScanCodeSet::ps2 = 3,
  ScanCodeSet::error = 0xff
}
 
enum  DiagnosticsLedBlink { DiagnosticsLedBlink::heartbeat, DiagnosticsLedBlink::blinkOnError, DiagnosticsLedBlink::toggleHigh, DiagnosticsLedBlink::toggleLow }
 Used with SimpleDiagnostics to control the behavior of a pin that will signal the device's user that an error has been recorded. More...
 
enum  TypematicRate : uint8_t {
  TypematicRate::fastestRate = 0x00, TypematicRate::slowestRate = 0x1f, TypematicRate::defaultRate = 0x0b, TypematicRate::_30_0_cps = 0x00,
  TypematicRate::_26_7_cps = 0x01, TypematicRate::_24_0_cps = 0x02, TypematicRate::_21_8_cps = 0x03, TypematicRate::_10_9_cps = 0x0b,
  TypematicRate::_02_3_cps = 0x1d, TypematicRate::_02_1_cps = 0x1e, TypematicRate::_02_0_cps = 0x1f
}
 
enum  TypematicStartDelay : uint8_t {
  TypematicStartDelay::longestDelay = 0x3, TypematicStartDelay::shortestDelay = 0x0, TypematicStartDelay::defaultDelay = 0x1, TypematicStartDelay::_0_25_sec = 0x0,
  TypematicStartDelay::_0_50_sec = 0x1, TypematicStartDelay::_0_75_sec = 0x2, TypematicStartDelay::_1_00_sec = 0x3
}
 
enum  UsbKeyboardLeds {
  UsbKeyboardLeds::none = 0x0, UsbKeyboardLeds::numLock = 0x1, UsbKeyboardLeds::capsLock = 0x2, UsbKeyboardLeds::scrollLock = 0x4,
  UsbKeyboardLeds::all = 0x07
}
 The bitfield that describes USB LED's. More...
 

Functions

KeyboardLeds operator| (KeyboardLeds a, KeyboardLeds b)
 
KeyCode operator| (KeyCode code, KeyCode modifiers)
 
KeyCode operator& (KeyCode code, KeyCode modifiers)
 
KeyCodeoperator|= (KeyCode &code, KeyCode modifiers)
 
KeyCodeoperator&= (KeyCode &code, KeyCode modifiers)
 
KeyCode operator~ (KeyCode code)
 
Parity operator^= (Parity &a, int bit)
 

Variables

template<typename Diagnostics >
const char AnsiTranslator< Diagnostics >::ps2ToAsciiMap [] PROGMEM
 

Enumeration Type Documentation

◆ DiagnosticsLedBlink

Used with SimpleDiagnostics to control the behavior of a pin that will signal the device's user that an error has been recorded.

Enumerator
heartbeat 

The LED blinks slowly when there's no error and fast when an error has happened. (If you see a slow blink, then you at least know that the device is cycling through the loop and not stuck in a loop somewhere.)

blinkOnError 

The pin is left HIGH unless an error has been recorded, in which case it will be toggled on and off rapidly.

toggleHigh 

The pin is left LOW until an error is registered, at which point it switches to HIGH

toggleLow 

The pin is left HIGH until an error is registered, at which point it switches to LOW

◆ KeyboardLeds

enum ps2::KeyboardLeds
strong

The LED's available on a standard PS2 keyboard.

Enumerator
capsLock 
numLock 
scrollLock 
all 
none 

◆ KeyboardOutput

enum ps2::KeyboardOutput : uint8_t
strong

Byte-codes sent back from the Ps2 keyboard to the host.

Entries prefixed by "sc2" are from the standard "Scan Code Set 2". Those with "sc2ex" are from the same set, but the ones that are prefixed with the 'extend' byte. Entries prefixed by "sc3" are from the PS2 scan code set, which is far simpler, needing only one byte. Being the simpler option, it is, of course, widely shunned. Still, if you're building a device that's using an old ps2 keyboard to control it, you should strongly consider using that set.

Enumerator
none 
garbled 
batSuccessful 
batFailure 
ack 
echo 
nack 
unmake 
extend 
extend1 
sc2_numLock 
sc2_scrollLock 
sc2_capsLock 
sc2_leftShift 
sc2_rightShift 
sc2_leftCtrl 
sc2_leftAlt 
sc2_sysRequest 
sc2_esc 
sc2_backspace 
sc2_tab 
sc2_enter 
sc2_space 
sc2_keypad0 
sc2_keypad1 
sc2_keypad2 
sc2_keypad3 
sc2_keypad4 
sc2_keypad5 
sc2_keypad6 
sc2_keypad7 
sc2_keypad8 
sc2_keypad9 
sc2_keypadPeriod 
sc2_keypadPlus 
sc2_keypadDash 
sc2_keypadAsterisk 
sc2ex_keypadEnter 
sc2_KeypadEquals 
sc2_keypadComma 
sc2ex_keypadForwardSlash 
sc2_0 
sc2_1 
sc2_2 
sc2_3 
sc2_4 
sc2_5 
sc2_6 
sc2_7 
sc2_8 
sc2_9 
sc2_apostrophe 
sc2_comma 
sc2_dash 
sc2_period 
sc2_forwardSlash 
sc2_openQuote 
sc2_a 
sc2_b 
sc2_c 
sc2_d 
sc2_e 
sc2_f 
sc2_g 
sc2_h 
sc2_i 
sc2_j 
sc2_k 
sc2_l 
sc2_m 
sc2_n 
sc2_o 
sc2_p 
sc2_q 
sc2_r 
sc2_s 
sc2_t 
sc2_u 
sc2_v 
sc2_w 
sc2_x 
sc2_y 
sc2_z 
sc2_semicolon 
sc2_backslash 
sc2_europe2 
sc2_openSquareBracket 
sc2_closeSquareBracket 
sc2_equal 
sc2_f1 
sc2_f2 
sc2_f3 
sc2_f4 
sc2_f5 
sc2_f6 
sc2_f7 
sc2_f8 
sc2_f9 
sc2_f10 
sc2_f11 
sc2_f12 
sc2_f13 
sc2_f14 
sc2_f15 
sc2_f16 
sc2_f17 
sc2_f18 
sc2_f19 
sc2_f20 
sc2_f21 
sc2_f22 
sc2_f23 
sc2_f24 
sc2_intl1 
sc2_intl2 
sc2_intl3 
sc2_intl4 
sc2_intl5 
sc2_lang1 
sc2_lang2 
sc2_lang3 
sc2_lang4 
sc2_lang5 
sc2ex_pauseBreak 
sc2ex_rightCtrl 
sc2ex_rightAlt 
sc2ex_leftGui 
sc2ex_leftWindows 
sc2ex_rightGui 
sc2ex_rightWindows 
sc2ex_printScreen 
sc2ex_menu 
sc2ex_home 
sc2ex_end 
sc2ex_pageUp 
sc2ex_pageDown 
sc2ex_leftArrow 
sc2ex_rightArrow 
sc2ex_upArrow 
sc2ex_downArrow 
sc2ex_insert 
sc2ex_delete 
sc2ex_nextTrack 
sc2ex_prevTrack 
sc2ex_stop 
sc2ex_play 
sc2ex_mute 
sc2ex_volumeUp 
sc2ex_volumeDown 
sc2ex_mediaSelect 
sc2ex_email 
sc2ex_calculator 
sc2ex_myComputer 
sc2ex_webSearch 
sc2ex_webHome 
sc2ex_webBack 
sc2ex_webForward 
sc2ex_webStop 
sc2ex_webRefresh 
sc2ex_webFavorites 
sc2ex_power 
sc2ex_sleep 
sc2ex_wake 
sc3_a 
sc3_b 
sc3_c 
sc3_d 
sc3_e 
sc3_f 
sc3_g 
sc3_h 
sc3_i 
sc3_j 
sc3_k 
sc3_l 
sc3_m 
sc3_n 
sc3_o 
sc3_p 
sc3_q 
sc3_r 
sc3_s 
sc3_t 
sc3_u 
sc3_v 
sc3_w 
sc3_x 
sc3_y 
sc3_z 
sc3_0 
sc3_1 
sc3_2 
sc3_3 
sc3_4 
sc3_5 
sc3_6 
sc3_7 
sc3_8 
sc3_9 
sc3_keypadSlash 
sc3_keypadAsterisk 
sc3_keypadDash 
sc3_keypadPlus 
sc3_keypadEnter 
sc3_keypadPeriod 
sc3_keypad0 
sc3_keypad1 
sc3_keypad2 
sc3_keypad3 
sc3_keypad4 
sc3_keypad5 
sc3_keypad6 
sc3_keypad7 
sc3_keypad8 
sc3_keypad9 
sc3_f1 
sc3_f2 
sc3_f3 
sc3_f4 
sc3_f5 
sc3_f6 
sc3_f7 
sc3_f8 
sc3_f9 
sc3_f10 
sc3_f11 
sc3_f12 
sc3_openSquareBracket 
sc3_openQuote 
sc3_dash 
sc3_insert 
sc3_home 
sc3_pageUp 
sc3_delete 
sc3_end 
sc3_pageDown 
sc3_upArrow 
sc3_leftArrow 
sc3_downArrow 
sc3_rightArrow 
sc3_numLock 
sc3_capsLock 
sc3_leftShift 
sc3_leftCtrl 
sc3_leftGui 
sc3_leftWindows 
sc3_leftAlt 
sc3_rightShift 
sc3_rightCtrl 
sc3_rightGui 
sc3_rightWindows 
sc3_rightAlt 
sc3_backspace 
sc3_tab 
sc3_space 
sc3_enter 
sc3_equal 
sc3_backslash 
sc3_escape 
sc3_closeSquareBracket 
sc3_semicolon 
sc3_apostrophe 
sc3_comma 
sc3_period 
sc3_slash 
sc3_printScreen 
sc3_scrollLock 
sc3_pause 
sc3_apps 
sc3_menu 

◆ KeyCode

enum ps2::KeyCode : uint16_t

Describes a neutral encoding for keypresses used with the NeutralTranslator.

Enumerator
PS2_NONE 
PS2_SHIFT 
PS2_CTRL 
PS2_ALT 
PS2_GUI 
PS2_MODIFIERS 
PS2_KEY_NUM 
PS2_KEY_SCROLL 
PS2_KEY_CAPS 
PS2_KEY_PRTSCR 
PS2_KEY_PAUSE 
PS2_KEY_L_SHIFT 
PS2_KEY_R_SHIFT 
PS2_KEY_L_CTRL 
PS2_KEY_R_CTRL 
PS2_KEY_L_ALT 
PS2_KEY_R_ALT 
PS2_KEY_L_GUI 
PS2_KEY_R_GUI 
PS2_KEY_MENU 
PS2_KEY_BREAK 
PS2_KEY_SYSRQ 
PS2_KEY_HOME 
PS2_KEY_END 
PS2_KEY_PGUP 
PS2_KEY_PGDN 
PS2_KEY_L_ARROW 
PS2_KEY_R_ARROW 
PS2_KEY_UP_ARROW 
PS2_KEY_DN_ARROW 
PS2_KEY_INSERT 
PS2_KEY_DELETE 
PS2_KEY_ESC 
PS2_KEY_BS 
PS2_KEY_TAB 
PS2_KEY_ENTER 
PS2_KEY_SPACE 
PS2_KEY_KP0 
PS2_KEY_KP1 
PS2_KEY_KP2 
PS2_KEY_KP3 
PS2_KEY_KP4 
PS2_KEY_KP5 
PS2_KEY_KP6 
PS2_KEY_KP7 
PS2_KEY_KP8 
PS2_KEY_KP9 
PS2_KEY_KP_DOT 
PS2_KEY_KP_ENTER 
PS2_KEY_KP_PLUS 
PS2_KEY_KP_MINUS 
PS2_KEY_KP_TIMES 
PS2_KEY_KP_DIV 
PS2_KEY_0 
PS2_KEY_1 
PS2_KEY_2 
PS2_KEY_3 
PS2_KEY_4 
PS2_KEY_5 
PS2_KEY_6 
PS2_KEY_7 
PS2_KEY_8 
PS2_KEY_9 
PS2_KEY_APOS 
PS2_KEY_COMMA 
PS2_KEY_MINUS 
PS2_KEY_DOT 
PS2_KEY_DIV 
PS2_KEY_KP_EQUAL 
PS2_KEY_SINGLE 
PS2_KEY_A 
PS2_KEY_B 
PS2_KEY_C 
PS2_KEY_D 
PS2_KEY_E 
PS2_KEY_F 
PS2_KEY_G 
PS2_KEY_H 
PS2_KEY_I 
PS2_KEY_J 
PS2_KEY_K 
PS2_KEY_L 
PS2_KEY_M 
PS2_KEY_N 
PS2_KEY_O 
PS2_KEY_P 
PS2_KEY_Q 
PS2_KEY_R 
PS2_KEY_S 
PS2_KEY_T 
PS2_KEY_U 
PS2_KEY_V 
PS2_KEY_W 
PS2_KEY_X 
PS2_KEY_Y 
PS2_KEY_Z 
PS2_KEY_SEMI 
PS2_KEY_BACK 
PS2_KEY_OPEN_SQ 
PS2_KEY_CLOSE_SQ 
PS2_KEY_EQUAL 
PS2_KEY_KP_COMMA 
PS2_KEY_F1 
PS2_KEY_F2 
PS2_KEY_F3 
PS2_KEY_F4 
PS2_KEY_F5 
PS2_KEY_F6 
PS2_KEY_F7 
PS2_KEY_F8 
PS2_KEY_F9 
PS2_KEY_F10 
PS2_KEY_F11 
PS2_KEY_F12 
PS2_KEY_F13 
PS2_KEY_F14 
PS2_KEY_F15 
PS2_KEY_F16 
PS2_KEY_F17 
PS2_KEY_F18 
PS2_KEY_F19 
PS2_KEY_F20 
PS2_KEY_F21 
PS2_KEY_F22 
PS2_KEY_F23 
PS2_KEY_F24 
PS2_KEY_NEXT_TR 
PS2_KEY_PREV_TR 
PS2_KEY_STOP 
PS2_KEY_PLAY 
PS2_KEY_MUTE 
PS2_KEY_VOL_UP 
PS2_KEY_VOL_DN 
PS2_KEY_MEDIA 
PS2_KEY_EMAIL 
PS2_KEY_CALC 
PS2_KEY_COMPUTER 
PS2_KEY_WEB_SEARCH 
PS2_KEY_WEB_HOME 
PS2_KEY_WEB_BACK 
PS2_KEY_WEB_FORWARD 
PS2_KEY_WEB_STOP 
PS2_KEY_WEB_REFRESH 
PS2_KEY_WEB_FAVOR 
PS2_KEY_EUROPE2 
PS2_KEY_POWER 
PS2_KEY_SLEEP 
PS2_KEY_WAKE 
PS2_KEY_INTL1 
PS2_KEY_INTL2 
PS2_KEY_INTL3 
PS2_KEY_INTL4 
PS2_KEY_INTL5 
PS2_KEY_LANG1 
PS2_KEY_LANG2 
PS2_KEY_LANG3 
PS2_KEY_LANG4 
PS2_KEY_LANG5 

◆ Parity

enum ps2::Parity : uint8_t
strong
Enumerator
odd 
even 

◆ ScanCodeSet

enum ps2::ScanCodeSet : uint8_t
strong
Enumerator
defaultScanCodeSet 
pcxt 
pcat 
ps2 
error 

◆ TypematicRate

enum ps2::TypematicRate : uint8_t
strong
Enumerator
fastestRate 
slowestRate 
defaultRate 
_30_0_cps 
_26_7_cps 
_24_0_cps 
_21_8_cps 
_10_9_cps 
_02_3_cps 
_02_1_cps 
_02_0_cps 

◆ TypematicStartDelay

enum ps2::TypematicStartDelay : uint8_t
strong
Enumerator
longestDelay 
shortestDelay 
defaultDelay 
_0_25_sec 
_0_50_sec 
_0_75_sec 
_1_00_sec 

◆ UsbKeyboardLeds

enum ps2::UsbKeyboardLeds
strong

The bitfield that describes USB LED's.

Enumerator
none 
numLock 
capsLock 
scrollLock 
all 

Function Documentation

◆ operator&()

KeyCode ps2::operator & ( KeyCode  code,
KeyCode  modifiers 
)
inline

◆ operator&=()

KeyCode& ps2::operator &= ( KeyCode code,
KeyCode  modifiers 
)
inline

◆ operator^=()

Parity ps2::operator^= ( Parity a,
int  bit 
)
inline

◆ operator|() [1/2]

KeyboardLeds ps2::operator| ( KeyboardLeds  a,
KeyboardLeds  b 
)
inline

◆ operator|() [2/2]

KeyCode ps2::operator| ( KeyCode  code,
KeyCode  modifiers 
)
inline

◆ operator|=()

KeyCode& ps2::operator|= ( KeyCode code,
KeyCode  modifiers 
)
inline

◆ operator~()

KeyCode ps2::operator~ ( KeyCode  code)
inline

Variable Documentation

◆ PROGMEM

template<typename Diagnostics >
const byte AnsiTranslator<Diagnostics>::pauseKeySequence [] ps2::PROGMEM