Only for Kobo Sage
Tested on KOReader 2026.03
Follow these steps:
- Open .adds/koreader/koreader.sh
- Search for comment # If bluetooth is enabled, kill it
- Comment or delete both ifs below that, one refers to sunxi the other to nxp
e.g.
Code:
# If bluetooth is enabled, kill it.
# if [ -e "/sys/devices/platform/bt/rfkill/rfkill0/state" ]; then
# # That's on sunxi, at least
# IFS= read -r bt_state <"/sys/devices/platform/bt/rfkill/rfkill0/state"
# if [ "${bt_state}" = "1" ]; then
# echo "0" >"/sys/devices/platform/bt/rfkill/rfkill0/state"
# # Power the chip down
# ./luajit frontend/device/kobo/ntx_io.lua 126 0
# fi
# fi
# if grep -q "^sdio_bt_pwr " "/proc/modules"; then
# # And that's on NXP SoCs
# rmmod sdio_bt_pwr
# fi
A couple of lines further there is a killall line
Again comment or delete both bluetoothd and bluealsa (not 100% sure about this last one but better safe than sorry)
e.g.
Code:
killall -q -TERM nickel hindenburg sickel fickel strickel fontickel adobehost foxitpdf iink dhcpcd-dbus dhcpcd fmon nanoclock.lua # bluealsa bluetoothd
That's it for koreader.sh
- Now open .adds/koreader/frontend/device/kobo/device.lua
- Search for
Code:
self.input:open("fake_events")
- After that insert:
Code:
local success1, event3res = pcall(function()
self.input:open("/dev/input/event3")
end)
AFAIK unless you have more than one bluetooth device paired with Sage it will always be event3.
- Now you will be able to pair and connect your bt device and open KOReader with it enabled.
As many people have said if you open KOReader with bluetooth enabled, when you exit the system will crash. That has to do with the way the drivers are written and there is no way to prevent it. Remember to exit KOReader by rebooting the reader.
- To test and get the keycodes open tools -> more tools -> terminal emulator -> open terminal session
- Inside the terminal type
Code:
evtest /dev/input/event3
This command first lists the registered events and then says Testing... if you press a key/button on your BT device (say the key you want to use to go forward one page) you'll see several lines but the important one will be like:
Code:
Event: time 1675505630.867333, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70051
That is, a line that says type 4 and a MSC_SCAN value, in the example it is scancode "70051"
- Now the manual decoding part.
+ Part one: 7 means keyboard page and 0051 is the usage id. look that up in
https://usb.org/sites/default/files/hut1_21.pdf and you'll see page 0x07 usage id 51 is Keyboard DownArrow
+ Part two: look for down arrow either on evtest's initial listing or in
https://github.com/torvalds/linux/bl...-event-codes.h either way you'll find it corresponds to keycode 108.
That last code is what we need for the final config in KOReader, I'll keep using the example but you have to use the value you found.
- Create or modify .adds/koreader/settings/event_map.lua
+ If the file already exists and it already maps 108 to a string you'll have to change the string to "RPgFwd" (or "RPgBack" if you're mapping the "go back" key/button)
+ If the file exists but it doesn't have a line with 108 then you'll have to insert a line like [108] = "RPgFwd",
+ Finally if there is no event_map.lua file in settings, create one and type this inside:
Code:
return {
[108] = "RPgBack",
[103] = "RPgFwd",
}
The important thing is wou have to replace the example 108 and 103 with the values you decoded earlier.
Not simple but it works. Unfortunatelly the feature that would have made everything easier, at least for finding the keycode, aparently isn't available in KOReader for Kobo
That's it.