
[SOLVED] How to tweak touchscreen event handling? Cheap tablet produces events, but Firefox sometimes misses them...
In an attempt to construct a user interface for a Raspberry PI project, I purchased a cheap 7" Chinese made Android 4.1.1 tablet. It's an InfoTMIC Y88 device with an IMAPX15 dual core CPU. The device seems to exceed the performance requirements for my simple task, netting a AnTuTu benchmark of 5512. General web surfing seems quite snappy, and I have had no other issues with the device beyond what is described below.
My project requires a custom keypad which I had hoped to implement via HTML5/javascript in a full screen Firefox browser, and I am having all sorts of problems getting the keypad to respond consistently. I am using button type input elements with onClick event handlers. Both the keypad page and Firefox function 100% on my desktop PCs, an ASUS Transformer tablet, a Google Nexus 7 tablet, and even my old HTC Thunderbolt phone, but not so with the cheap tablet...
The HTML input buttons sometimes appear to stick down as if they never received a 'MouseUp' event, and sometimes the buttons never seem to depress at all as if they never received a 'MouseDown' event. The behavior can be demonstrated/replicated on this page:
http://www.webestools.com/ftp/ybouane/scripts_tutorials/javascript/calculator/calculator.html
I suspected the hardware was faulty (who wouldn't?), but I attached the android debugger via USB, and ran:
# getevent -d -l /dev/input/event3
I am able to see both the UP and DOWN events even though Firefox sometimes (50% of the time) fails to respond to one or both:
EV_KEY BTN_TOUCH DOWN EV_ABS ABS_MT_TOUCH_MAJOR 0000000f EV_ABS ABS_MT_POSITION_X 000000ce EV_ABS ABS_MT_POSITION_Y 000000fb EV_ABS ABS_MT_TOUCH_MAJOR 0000000f EV_SYN SYN_MT_REPORT 00000000 EV_SYN SYN_REPORT 00000000 EV_ABS ABS_MT_TOUCH_MAJOR 0000000f EV_ABS ABS_MT_POSITION_X 000000d1 EV_ABS ABS_MT_POSITION_Y 000000fd EV_ABS ABS_MT_TOUCH_MAJOR 0000000f EV_SYN SYN_MT_REPORT 00000000 EV_SYN SYN_REPORT 00000000 EV_ABS ABS_MT_TOUCH_MAJOR 0000000f EV_ABS ABS_MT_POSITION_X 000000d4 EV_ABS ABS_MT_POSITION_Y 000000fe EV_ABS ABS_MT_TOUCH_MAJOR 0000000f EV_SYN SYN_MT_REPORT 00000000 EV_SYN SYN_REPORT 00000000 EV_KEY BTN_TOUCH UP
I looked through about:config but didn't see anything obvious. Any assistance or clues will be greatly appreciated!
SOLUTION: I discovered the ontouchstart and ontouchend events which are not mentioned in the HTML5 reference at w3schools.com. Event handlers for these events seem to have solved my problem entirely.
Modified
Chosen solution
I'm glad you solved your problem! :)
Read this answer in context 👍 0All Replies (2)
Chosen Solution
I'm glad you solved your problem! :)
This was flagged for moderation, and I suppose maybe it is not on topic; as within the usual general scope of this forum.
It does however make me think because it is a post relating to Android use. And it is a post about Raspberry Pi, and that is capable of supporting Firefox OS.
I guess it may be more suitable to post on a Mozillazine forum. Maybe someone needs to start a discussion about what now is considered on topic on these forums.
I will let the moderation flag stand and someone else may make a decision to lock the thread, but I am not locking it myself.
If anyone does lock it it may be interesting to know what the recommended forum for such posts may be ?
Edit
In fact the moderation flag was set because this is a resolved issue (but no chosen solution) so I have marked it solved and cleared the flag.
Modified