|  03-07-2018, 08:46 AM | #406 | |
| Addict            Posts: 209 Karma: 83543 Join Date: Jan 2018 Device: none | Quote: 
 The Monitor app also mentioned that power might be a problem when I started it up. When I have the Max 2 connected to a USB power adapter, I don't recall getting such messages. | |
|   |   | 
|  03-07-2018, 08:59 AM | #407 | 
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | 
			
			Tested, it works!  One note: I think `logcat` should be already opened with the filtering (similar to the above I posted), so you process something already cleaned up - which I presume should be faster. The good idea about python is that it will work everywhere - linux, win, mac - ; it should be seen if this whole idea will be fast enough. For doing more native code, posting mouse events should be trivial in Win (the functions are there in the Win32 API), but I have not understood yet the low level trick in Linux. Anyway, as I wrote the Monitor code should probably come to include the tap-down (now it only gets "tap up"), so that also drag-and-drop could work... | 
|   |   | 
|  03-07-2018, 09:04 AM | #408 | |
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | Quote: 
 | |
|   |   | 
|  03-07-2018, 04:47 PM | #409 | 
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | 
			
			So since we understood that there may be a simple method that allows to use the HDMI based "Monitor" software from Onyx also as a touchpad - in other words, the Max2 (etc.) becomes a touchscreen monitor - I further modified the (modifications on the) original code to allow the magic with the tricks we can afford here.  Now, with this version: -- tapping on the NW corner ("corner" = within 100 dots) opens the original menu. Tapping on the main region of the screen does not open the menu anymore, because you are supposed to able to use it as a touchscreen; -- tapping on the NE corner requests a full screen refresh; -- tapping on the SW corner changes EPD mode to Normal / high quality; -- tapping on the SE corner changes EPD mode to A2 / fast mode; -- long tap does not trigger any more the "Exit?" menu, because you should be allowed to drag the mouse pointer around. Upon touch, the application logs the taps the following way: 03-07 22:32:02.247: I/OnyxMonitEv(3434): T:0|1643,716 03-07 22:32:02.403: I/OnyxMonitEv(3434): T:1|1593,733 03-07 22:32:03.520: I/OnyxMonitEv(3434): T:0|623,849 03-07 22:32:03.960: I/OnyxMonitEv(3434): T:1|1202,539 03-07 22:32:05.520: I/OnyxMonitEv(3434): T:0|1694,814 03-07 22:32:05.637: I/OnyxMonitEv(3434): T:1|1694,814 and these logs could be used to reflect with mouse actions on the source desktop. Sogaiu has already written a python script that does the job, I will soon modify it to match with this "more precise" Monitor version. For the technically inclined, I also attached the main "modification" (outside this files the interventions are very scarce). Last edited by mdp; 03-07-2018 at 04:51 PM. | 
|   |   | 
|  03-07-2018, 05:33 PM | #410 | 
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | 
			
			@Sogaiu:  almost there, the "popen" now must be process = subprocess.Popen(['adb', 'logcat', 'OnyxMonitEv:I *:S'], stdout=subprocess.PIPE) and the regular expression line_re = re.compile("^(\d+)-(\d+) (\d+)  \d+)  \d+)\.(\d+).*?OnyxMonitEv: T  ?P<e>\d+)\|(?P<x>\d+),(?P<y>\d+)") One scolio, the coordinates must be modified according to screen resolution (e.g. 2104x1560) and display resolution (presumably 2200x1650) - such as mouse_x = tap_x*2104/2200 I cannot finish this evening... | 
|   |   | 
|  03-07-2018, 05:57 PM | #411 | 
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | 
			
			...and it works like a charm!  I cannot finish the script, but already like it is (dirty, with hardcoded values etc.) it plain works! Check the video out! :champagne:   The core, for quick replication of the results: Code: 	while not stdout_reader.eof():
		while not stdout_queue.empty():
			line = stdout_queue.get()
			print(line)
			m = line_re.match(line)
			if m:
				e = int(m.group("e"))
				x = int(m.group("x"))*2104/2200
				y = int(m.group("y"))*1560/1650
				if(e==0):
					mouse.press(x,y)
				elif(e==1):
					mouse.release(x,y)The Onyx Monitor software fully improved to a touchscreen. I am impressed myself... | 
|   |   | 
|  03-07-2018, 08:20 PM | #412 | 
| Addict            Posts: 209 Karma: 83543 Join Date: Jan 2018 Device: none | 
			
			Nice! I watched the video, but also made similar modifications and verified it works  Some points I noticed: -The script is very CPU intensive. Not sure why yet. -I guess this setup works for mirrored screens, but perhaps some modifications are necessary for other modes of operation like "extended". -Not noticing the same kind of power drain as the last round of testing. | 
|   |   | 
|  03-08-2018, 05:15 AM | #413 | |
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | Quote: 
 logcat -T 1 and just skip processing that first line. Any request for a demo? | |
|   |   | 
|  03-08-2018, 06:47 AM | #414 | 
| Addict            Posts: 209 Karma: 83543 Join Date: Jan 2018 Device: none | |
|   |   | 
|  03-08-2018, 07:25 AM | #415 | 
| Addict            Posts: 209 Karma: 83543 Join Date: Jan 2018 Device: none | 
			
			Also working on skipping lines that are before the time that the script started executing.  Going to assume that the device's time and the host's time are close.  Looks like adb logcat output doesn't contain year info...
		 | 
|   |   | 
|  03-08-2018, 11:03 AM | #416 | |
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | Quote: 
 process = subprocess.Popen(['adb', 'logcat', '-T1', 'OnyxMonitEv:I *:S'], stdout=subprocess.PIPE) EDIT: should you wish to accept your mission, the script should, at the begnning, check the screen resolution. Because those hardcoded values in Code: 				x = int(m.group("x"))*2104/2200
				y = int(m.group("y"))*1560/1650The other two values, the tablet resolution, could be taken with another adb command (maybe an `adb shell getprop [...]` EDIT: more exactly, `adb shell getprop ro.product.board` returns 'Max2'. You can use a switch on that output to impose that tablet_res_w = 2200 and tablet_res_h = 1650. With the Note, which will get another value as "ro.product.board", the conditional will acquire another branch towards values tablet_res_w = 1872 and tablet_res_h = 1404. Last edited by mdp; 03-08-2018 at 11:23 AM. | |
|   |   | 
|  03-08-2018, 11:10 AM | #417 | |
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | 
			
			Meanwhile, I took a video. I mean, so amazing that it has to be more properly demonstrated: the Max2 in an HDMI monitor session, acting as a touchscreen.  https://youtu.be/apzWhVjpS6o The current (unimaginative) description: Quote: 
 | |
|   |   | 
|  03-08-2018, 04:47 PM | #418 | ||
| Addict            Posts: 209 Karma: 83543 Join Date: Jan 2018 Device: none | 
			
			Ah, I see.  Thanks for the persistence   On a side note, it seems silly that there's both a -T <count> and a -T '<time>' Quote: 
 Quote: 
 | ||
|   |   | 
|  03-08-2018, 05:23 PM | #419 | 
| Addict            Posts: 209 Karma: 83543 Join Date: Jan 2018 Device: none | 
			
			May be the folks with interest in using the Max 2 with the Raspberry Pi will be interested too. I think I saw the "touching the bottom left corner" functionality working still -- is that correct? If so, is that distinguishable from a click / touch intended for the desktop? I guess there is an answer in the .smali  P.S. The double-clicking looked slightly tricky. How was that for you? | 
|   |   | 
|  03-08-2018, 06:29 PM | #420 | 
| Wizard            Posts: 1,481 Karma: 9010563 Join Date: Jul 2013 Device: none | 
			
			I think the (mouse) coordinates get an offset:  the most frequent case could be: mouse_x = main_screen_width + second_screen_x mouse_y = second_screen_y meaning the extension is eastward, but it could be anything. A setting must be read to determine it. | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Onyx boox i62 or Onyx boox 92M for PDF reading? | tidyboyd | Which one should I buy? | 16 | 04-02-2013 04:19 PM | 
| ONYX BOOX 1.5.1 A60/X60/X60S(onyx-international.com) | samerghafik | Onyx Boox | 4 | 01-03-2011 01:32 AM | 
| Ended Onyx Boox 60 - NEW | pashlit | Flea Market | 2 | 08-18-2010 04:27 PM | 
| Ended Onyx Boox 60 | puglover333 | Flea Market | 0 | 05-19-2010 10:05 AM | 
| Onyx Boox 60 S | Thomasss | News | 40 | 03-03-2010 03:03 PM |