Updated Android tips and tricks (markdown)

master
Martín Fernández 4 years ago
parent 881fa7ea3e
commit f1fe47cde2

@ -1,33 +1,31 @@
## Customize keys
You can customize key mappings by creating koreader/settings/event_map.lua with the things to override.
KOReader supports [keymappings](https://github.com/koreader/koreader/wiki/Keymapping). While most phones and tablets use common keycodes defined by AOSP, some "closed-android" e-ink vendors use their own scheme.
#### example 1: override the camera key with a page forward event:
**NOTE:** it is impossible for a non-launcher app to override the behaviour of the home key. The rest of physical/virtual keys can be mapped.
#### example 1: add support for the custom keys used on the [Nook Glowlight 3](https://www.mobileread.com/forums/showpost.php?p=3922840&postcount=23) (top keys as page back and bottom keys as page forward)
```lua
return {
[27] = "LPgFwd",
[139] = "LPgBack", -- Nook Left Page Back (left lower button)
[140] = "LPgFwd", -- Nook Left Page Forward (left upper button)
[141] = "LPgFwd", -- Nook Right Page Forward (right upper button)
[142] = "LPgBack", -- Nook Right Page Back (right lower button)
}
```
#### example 2: use key 200 as the back key
#### example 2: add support for the custom keys used on the [Tolino Epos 2](https://github.com/koreader/koreader/issues/5761#issuecomment-573358732)
```lua
return {
[200] = "Back",
[21] = "LPgBack",
[22] = "LPgFwd",
}
```
#### example 3: add support for the custom keys used on the [Nook Glowlight 3](https://www.mobileread.com/forums/showpost.php?p=3922840&postcount=23) (top keys as page back and bottom keys as page forward)
To know which keycodes are being emmited by your device please follow [this link](https://github.com/koreader/koreader/issues/5761#issuecomment-573345775)
```lua
return {
[139] = "LPgBack", -- Nook Left Page Back (left lower button)
[140] = "LPgFwd", -- Nook Left Page Forward (left upper button)
[141] = "LPgFwd", -- Nook Right Page Forward (right upper button)
[142] = "LPgBack", -- Nook Right Page Back (right lower button)
}
```
## Customize dictionary list

Loading…
Cancel
Save