Files
koreader-mirror/spec/unit/externalkeyboard_event_map_spec.lua
okaykoaandFrans de Jonge 0f4836ecad Add layout framework for external keyboard text input (#16024)
Fixes #13278.

* Add correct external keyboard punctuation key names
* Compose physical-keyboard text via a layout and TextInput
* Expand to multiple possible layers
* Add XKB conversion script
* Give ourselves some dead key support
* Add license identifier
* Improve AltGr
* Group the layouts together
* And add the common layouts
* Expand with regular US international (with regular non-AltGr dead keys)
* Add some other scripts (that should do it)
* [fix] Avoid rotating up/down in external keyboards along with the device orientation
* Log keyboard layout in case of issues
* Also listen to PrintScr 'cause that's what the thing is for, isn't it

---------

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2026-09-16 20:33:07 +02:00

13 lines
613 B
Lua

describe("ExternalKeyboard event_map_keyboard", function()
local event_map = dofile("plugins/externalkeyboard.koplugin/event_map_keyboard.lua")
it("gives the base punctuation keys their correct names", function()
assert.are.equal("-", event_map[12]) -- KEY_MINUS
assert.are.equal("=", event_map[13]) -- KEY_EQUAL
assert.are.equal("[", event_map[26]) -- KEY_LEFTBRACE
assert.are.equal("]", event_map[27]) -- KEY_RIGHTBRACE
assert.are.equal(";", event_map[39]) -- KEY_SEMICOLON (was ":")
assert.are.equal("`", event_map[41]) -- KEY_GRAVE
end)
end)