mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[chore] device/input: migrate custom event map to settings dir (#3822)
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
An interface to get input events.
|
||||
]]
|
||||
|
||||
local DataStorage = require("datastorage")
|
||||
local DEBUG = require("dbg")
|
||||
local Event = require("ui/event")
|
||||
local Key = require("device/key")
|
||||
local GestureDetector = require("device/gesturedetector")
|
||||
local Key = require("device/key")
|
||||
local TimeVal = require("ui/timeval")
|
||||
local framebuffer = require("ffi/framebuffer")
|
||||
local input = require("ffi/input")
|
||||
@@ -150,7 +151,9 @@ function Input:init()
|
||||
self.event_map[10021] = "NotCharging"
|
||||
|
||||
-- user custom event map
|
||||
local ok, custom_event_map = pcall(dofile, "custom.event.map.lua")
|
||||
local custom_event_map_location = string.format(
|
||||
"%s/%s", DataStorage:getSettingsDir(), "event_map.lua")
|
||||
local ok, custom_event_map = pcall(dofile, custom_event_map_location)
|
||||
if ok then
|
||||
for key, value in pairs(custom_event_map) do
|
||||
self.event_map[key] = value
|
||||
|
||||
Reference in New Issue
Block a user