mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #767 from houqp/new_ui_houqp
add ev log in debug mode
This commit is contained in:
@@ -478,6 +478,12 @@ function Input:waitEvent(timeout_us, timeout_s)
|
||||
|
||||
if ok and ev then
|
||||
ev = self:eventAdjustHook(ev)
|
||||
if G_debug_mode then
|
||||
local log = ev.type.."|"..ev.code.."|"
|
||||
..ev.value.."|"..ev.time.sec.."|"..ev.time.usec.."\n"
|
||||
G_ev_log:write(log)
|
||||
G_ev_log:flush()
|
||||
end
|
||||
if ev.type == EV_KEY then
|
||||
return self:handleKeyBoardEv(ev)
|
||||
elseif ev.type == EV_ABS or ev.type == EV_SYN then
|
||||
|
||||
@@ -149,6 +149,10 @@ end
|
||||
local argidx = 1
|
||||
if ARGV[1] == "-d" then
|
||||
argidx = argidx + 1
|
||||
G_debug_mode = true
|
||||
os.execute("echo > ev.log")
|
||||
-- create ev log file
|
||||
G_ev_log = io.open("ev.log", "w")
|
||||
else
|
||||
DEBUG = function() end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user