HDMI Monitor: mode toggle, quick UI, touchscreen

The Monitor (HDMI source) software from Onyx can be improved in many areas. I explored a few and obtained several well-usable proof of concepts, filmed for youtube (see "Onyx Boox Max2, HDMI monitor: Touchscreen " for example) and detailed in the relevant thread at mobileread.com.

Using both Greyscale Update and A2/Fast mode

The Monitor app switches to A2/Fast mode. But while A2 is useful while showing animations, you want to be in normal/GU mode when reading the page contents. The user should be made able to quickly switch between GU to A2.

Quick user interface

The Monitor app uses a toolbar that appears when tapping on the screen. As per the above, the user can interact faster with the interface by dividing the screen in more parts.
In my proof of concept, tapping on the screen corners (100x100 px areas) triggers different actions:
– the north-west corner opens the original toolbar;
– the north-east corner triggers a full screen refresh;
– the south-west corner triggers Greyscale Update mode;
– the south-east corner triggers A2/Fast mode.
The long-tap on the screen is left inert, just like tapping on most of the screen, in order to allow for touchscreen. Please see below (at the bottom of this post) a sample modification proposed (in Java).

Touchscreen for mouse emulation

Several ways to also use the touchscreen are possible; it appeared “cheap and effective” to make a python script (comfortable because multiplatform) interact with a log produced by the Monitor software.
This way, we can - for example, enumerating just what already tested - successfully simulate:
– with a single tap, left mouse button down;
– with two-fingers tap, right mouse button click;
– with two-fingers slide, mouse wheel rotation.
A sample script is available here (bottom of the page).

Debug “flashing” effect

As expressed in a different thread, it seems that some sources processed by the Monitor software produce a static output when the source desktop is static, other a constantly updated screen. In A2 mode, an intel NUC as source correctly shows static dots, while a GeForce 1060 has continuously changing dots on the screen (a “swarm” effect); in GU mode, areas of the screen that are akin to be very near to color #808080 (for example #7f8180, but not with #7f7f7f or #828282), flash continuously. Of course, this is very bad not only visually (in A2 mode, the screen looks pulsating), but also for the battery.
A stabilizer may be needed - and in general an assessment of this unwanted effect.

Please find below a sample of proposed modifications for the Monitor software, for quick UI and basic event logging to allow for mouse emulation from touch at desktop level:

(Note: I took Motion Event Actions 0, 1, 6 and 261 because they were enough and effective to simulate the most important mouse events, while keeping the log output very light. This choice comes from having assessed the events produced by touch, not by having followed the Android documentation cleanly.)

// Class: 
// com.onyx.android.monitor.PreviewFragment.java
//
// Method: 
// public void onViewCreated(View view, Bundle bundle) { ... 


		this.binding.texture.setOnLongClickListener(new View.OnLongClickListener(){
            public boolean onLongClick(View view) {
                return true;		// Removed: long click conflicts with mouse emulation 
            }
        });
		
		// setOnClickListener replaced with setOnTouchListener to get the coordinates 
        this.binding.texture.setOnTouchListener(new View.OnTouchListener(){
            public boolean onTouch(View view, MotionEvent motionEvent) {
                int n = motionEvent.getAction();
                if (n == 0 || n == 1 || n == 6 || n == 261) {  // backward engineered: not following the documentation
					int x = (int)motionEvent.getX();
					int y = (int)motionEvent.getY();
					int w = view.getWidth();
					int h = view.getHeight();
					Log.i((String)"OnyxMonitEv", (String)("T:" + n + "|" + x + "," + y));
					if (n == 1){
						if (x < 100 && y < 100) {
							PreviewFragment.this.getMenuDialog().show();
						}else if (x < 100 && y > (h-100)) {
							exitA2();
						}else if (x > (w-100) && y < 100) {
							gcRefreshOnce();
						}else if (x > (w-100) && y > (h-100)){
							enterA2();
						}
					}
				}
                return false;
            }
        });

Thank you for your suggestion, We will forward this to our software department. :+1:

Hello there! interested in this :slight_smile: