mirror of
https://github.com/koreader/koreader
synced 2024-11-18 03:25:46 +00:00
9b2201a438
* Added a new plugin external-keyboard. It listens to USB events. When keyboard is plugged in or plugged out, it updates device and input configuration accordingly. * Added new fake events UsbDevicePlugIn and UsbDevicePlugOut that are emitted when a device is connected to a book reader that plays the role of USB host. The usage of the existing events UsbPlugIn and UsbPlugOut has not changed - they are used when a reader is connected to a host. The koreader-base has a related PR for those events. * Did a small refactoring of initialization for the modules FocusManager and InputText. They check device keyboard capabilities on their when the module is first loaded and store it. Some of the initialization code has been extracted into functions, so that we can re-initialize them when keyboard is (dis)connected. * Initial implementation centered around text input, and tested with USB keyboards on devices with OTG support. * Said OTG shenanigans are so far supported on devices with debugfs & the chipidea driver, or sunxi devices.
73 lines
1.8 KiB
Lua
73 lines
1.8 KiB
Lua
--[[
|
|
event map for full-size keyboards.
|
|
--]]
|
|
|
|
return {
|
|
[2] = "1", [3] = "2", [4] = "3", [5] = "4", [6] = "5", [7] = "6", [8] = "7", [9] = "8", [10] = "9", [11] = "0",
|
|
[16] = "Q", [17] = "W", [18] = "E", [19] = "R", [20] = "T", [21] = "Y", [22] = "U", [23] = "I", [24] = "O", [25] = "P",
|
|
[30] = "A", [31] = "S", [32] = "D", [33] = "F", [34] = "G", [35] = "H", [36] = "J", [37] = "K", [38] = "L", [39] = ":", [40] = "'",
|
|
[44] = "Z", [45] = "X", [46] = "C", [47] = "V", [48] = "B", [49] = "N", [50] = "M", [51] = ",", [52] = ".", [53] = "/",
|
|
|
|
[14] = "Backspace",
|
|
[15] = "Tab",
|
|
[28] = "Press", -- Enter
|
|
[29] = "LCtrl",
|
|
[42] = "Shift", -- Left Shift
|
|
[43] = "\\",
|
|
[54] = "Shift", -- Right Shift
|
|
[56] = "LAlt",
|
|
[58] = "CapsLock",
|
|
[57] = " ",
|
|
[59] = "F1",
|
|
[60] = "F2",
|
|
[61] = "F3",
|
|
[62] = "F4",
|
|
[63] = "F5",
|
|
[64] = "F6",
|
|
[65] = "F7",
|
|
[66] = "F8",
|
|
[67] = "F9",
|
|
[68] = "F10",
|
|
[69] = "NumLock",
|
|
[70] = "ScrollLock",
|
|
|
|
[71] = "KP7",
|
|
[72] = "KP8",
|
|
[73] = "KP9",
|
|
[74] = "KPMinus",
|
|
[75] = "KP4",
|
|
[76] = "KP5",
|
|
[77] = "KP6",
|
|
[78] = "KPPlus",
|
|
[79] = "KP1",
|
|
[80] = "KP2",
|
|
[81] = "KP3",
|
|
[82] = "KP0",
|
|
[87] = "F11",
|
|
[88] = "F12",
|
|
[96] = "Press", -- KPEnter
|
|
|
|
[97] = "Ctrl", -- Right Ctrl
|
|
[98] = "Home",
|
|
[99] = "PrintScr", -- Also SysRq
|
|
[100] = "RAlt",
|
|
[102] = "Home",
|
|
[103] = "Up",
|
|
[104] = "LPgBack", -- PageUp
|
|
[105] = "Left",
|
|
[106] = "Right",
|
|
[107] = "End",
|
|
[108] = "Down",
|
|
[109] = "LPgFwd", -- PageDown
|
|
[110] = "Ins",
|
|
[111] = "Del",
|
|
[114] = "VMinus",
|
|
[115] = "VPlus",
|
|
[116] = "Power",
|
|
[119] = "Pause",
|
|
[125] = "LMeta", -- Meta, Win, Cmd, etc.
|
|
[126] = "RMeta",
|
|
[127] = "Compose",
|
|
[139] = "Menu",
|
|
}
|