08-30-2019, 05:30 PM | #1 |
Junior Member
Posts: 5
Karma: 228
Join Date: Nov 2017
Device: Kindle Touch
|
Help: VNC touchscreen input
I have a jailbroken Kindle Touch onto which I've downloaded hawhill's Kindle VNC viewer (native app, GPLv2). I've managed to get most things working but I'm unable to get touchscreen input to be detected when the app is running. My lua config script does detect when I push the home button and exit the app as intended, but nothing is happening if I tap the touchscreen. However if I run evtest on the kindle, I can see that there are touch events being generated. I imagine there must be a typo in my config file but I'm not familiar with Lua. I've tried everything I can think of and would really appreciate help fixing this bug. On Linux (raspberry pi 3) I run the following in the terminal: Code:
sudo ifconfig usb0 192.168.15.2 x11vnc -clip 800x600+0+0 -usepw & ssh root@kindletouch-usb0 Code:
stop lab126_gui cd /mnt/us/extensions/kvncviewer/ lipc-get-prop com.lab126.powerd preventScreenSaver lipc-set-prop com.lab126.powerd preventScreenSaver 1 ./luajit vncviewer.lua -password <PASSWORD> -config config_touch_v2.lua -rotateFB270 -waitRefresh 40 -refreshFullAfterPixels 5 -dither_bw -medium 192.168.15.2:1 start lab126_gui lipc-set-prop com.lab126.powerd preventScreenSaver 0 Code:
require "keys" require "rfbkeys" -- comment out the following line on a KDX set_k3_keycodes() -- variables client_width and client_height will be available when handleInput() is called client_width = 0 client_height = 0 --[[ you have also the following API functions: Quit( [status] ) will quit the application. optional: return code (must be positive) SendKeyEvent( keyCode, pressed ) sends a key event to the rfb server. "pressed" is a bool value telling whether the key was pressed (true) or released (false) SendPointerEvent( x, y, buttonMask ) sends a pointer event to the rfb server ]]-- -- globals for remembering key state shift = false sym = false --touchscreen clickevent = 0 x, y = 0, 0 -- this handler will be called upon key presses (input events, actually) function handleInput(channel, itype, code, value) print("input:", "ch=", channel, "itype=", itype, "code=", code, "value=", value) --touch if itype == 1 then if code == 102 then print("pushed menu button") Quit() end elseif itype == 3 then if code == 57 then print("MT Tracking ID", value) clickevent = value + 1 if x and y then SendPointerEvent(x, y, 0) end elseif code == 53 then print("MT X", value) x = value elseif code == 54 then print("MT Y", value) y = value if clickevent == 1 then SendPointerEvent(x, y, 1) end end end end Code:
[root@kindle kvncviewer]# stop lab126_gui [root@kindle kvncviewer]# evtest /dev/input/event3 Input driver version is 1.0.0 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "zforce" Supported events: Event type 0 (Sync) Event type 1 (Key) Event code 0 (Reserved) Event code 1 (Esc) Event code 325 (ToolFinger) Event code 330 (Touch) Event code 333 (Tool Doubletap) Event code 334 (Tool Tripletap) Event type 3 (Absolute) Event code 0 (X) Value 0 Min 0 Max 4095 Event code 1 (Y) Value 0 Min 0 Max 4095 Event code 47 (MT Slot) Value 0 Min 0 Max 1 Event code 53 (MT X) Value 0 Min 0 Max 4095 Event code 54 (MT Y) Value 0 Min 0 Max 4095 Event code 57 (MT Tracking ID) Value 0 Min 0 Max 255 Event: time 1428263857.131751, type 3 (Absolute), code 57 (MT Tracking ID), value 0 Event: time 1428263857.131814, type 3 (Absolute), code 53 (MT X), value 1805 Event: time 1428263857.131828, type 3 (Absolute), code 54 (MT Y), value 2089 Event: time 1428263857.132372, type 1 (Key), code 330 (Touch), value 1 Event: time 1428263857.132384, type 1 (Key), code 325 (ToolFinger), value 1 Event: time 1428263857.132401, -------------- Report Sync ------------ Event: time 1428263857.147612, type 3 (Absolute), code 57 (MT Tracking ID), value -1 Event: time 1428263857.148175, type 1 (Key), code 330 (Touch), value 0 Event: time 1428263857.148187, type 1 (Key), code 325 (ToolFinger), value 0 Event: time 1428263857.148199, -------------- Report Sync ------------ |
08-31-2019, 07:13 PM | #3 |
Junior Member
Posts: 6
Karma: 10
Join Date: Aug 2019
Device: KT, PPW3
|
Hi, I got my kindle ppw 3 touch screen working with kvncviewer.
Content of my config.lua file Code:
require "keys" require "rfbkeys" set_k3_keycodes() client_width = 0 client_height = 0 -- globals for remembering key state shift = false sym = false myx = 0 myy = 0 -- this handler will be called upon key presses (input events, actually) function handleInput(channel, itype, code, value) if itype == 3 and code == 53 then myx = value end if itype == 3 and code == 54 then myy = value SendPointerEvent(myx, myy, 0) end if itype == 3 and code == 57 and value == -1 then SendPointerEvent(myx, myy, 1) SendPointerEvent(myx, myy, 0) end end |
09-01-2019, 04:11 PM | #4 |
Junior Member
Posts: 6
Karma: 10
Join Date: Aug 2019
Device: KT, PPW3
|
Btw given config.lua was written by looking into this example.
Accidentally I found that touch input was already done in this post. |
09-03-2019, 07:11 PM | #5 |
Junior Member
Posts: 5
Karma: 228
Join Date: Nov 2017
Device: Kindle Touch
|
NiLuJe... You are a genius! That fixed it! Thank you so much. In case anyone else has the same problem running this on a kindle touch, here is how to fix it: Open vncviewer.lua in a text editor and go to line 282 Code:
try_open_input("/dev/input/event0") try_open_input("/dev/input/event1") try_open_input("/dev/input/event2") Code:
try_open_input("/dev/input/event3") Code:
-- this handler will be called upon key presses (input events, actually) function handleInput(channel, itype, code, value) -- print("input:", "ch=", channel, "itype=", itype, "code=", code, "value=", value) --touch if itype == 1 then if code == 102 then print("pushed menu button") Quit() end elseif itype == 3 then if code == 57 then print("MT Tracking ID", value) clickevent = value + 1 if x and y then SendPointerEvent(x, y, 0) end elseif code == 53 then print("MT X", value) y = math.floor(value*600/4095) elseif code == 54 then x = 800 - math.floor(value*800/4095) print("MT Y", value) if clickevent == 1 then SendPointerEvent(x, y, 1) end end end end The only way I've been able to get a decent refresh rate is to use the '-dither_bw' option. This lets me get a great refresh rate (I can even watch youtube videos on a kindle now) but it comes at the cost of each individual frame looking uglier. Have you had good results without needing to use this option? |
Advert | |
|
Tags |
evtest, kindle touch, lua, touchsceen, vnc |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Conversion Input] KePub Input | jgoguen | Plugins | 23 | 05-17-2020 04:01 PM |
[Conversion Input] Microsoft Doc Input Plugin | igi | Plugins | 76 | 06-28-2019 05:47 AM |
Nook 1st Ed using touchscreen as mouse? (for android apps, VNC) | ninja_250cc | Barnes & Noble NOOK | 0 | 05-08-2016 12:53 AM |
REQ: input on Database Structure and testing a workaround input | jecilop | Library Management | 15 | 12-17-2015 01:10 AM |
[Input Plugin] DOCX Input | SauliusP. | Plugins | 42 | 06-05-2013 05:01 AM |