From 1a2f51cafb78d0137fb9e901c1e8891c4f8b2b8f Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 23 Dec 2011 23:27:26 +0100 Subject: [PATCH] auto-detect Kindle 3 based on /dev/input/event2 This is somewhat important, because if we are started without explicit -d k3 all key mappings are wrong, and user can't exit --- reader.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reader.lua b/reader.lua index 325f359b6..b589fe761 100755 --- a/reader.lua +++ b/reader.lua @@ -63,6 +63,15 @@ elseif optarg["d"] == "emu" then else input.open("/dev/input/event0") input.open("/dev/input/event1") + + -- check if we are running on Kindle 3 (additional volume input) + local f=lfs.attributes("/dev/input/event2") + print(f) + if f then + print("Auto-detected Kindle 3") + set_k3_keycodes() + end + end if optarg["G"] ~= nil then