Merge pull request #767 from houqp/new_ui_houqp

add ev log in debug mode
This commit is contained in:
Huang Xin
2013-02-23 23:41:44 -08:00
2 changed files with 10 additions and 0 deletions

View File

@@ -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

View File

@@ -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