Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] device/input: migrate custom event map to settings dir #3822

Merged
merged 2 commits into from Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontend/device/input.lua
Expand Up @@ -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")
Expand Down Expand Up @@ -147,7 +148,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
Expand Down