projectstorm / dynamouse

macOS multi-mouse & multi-external display assignment for complex screen and peripheral workstations.
MIT License
228 stars 3 forks source link

Issue with touch monitor #2

Open fonix232 opened 7 months ago

fonix232 commented 7 months ago

I've got a noname portable monitor with touchscreen - sadly even the EDID is cloned so there's no way to give an exact model.

Dynamouse properly recognises it as an input device, however pinning the pointer to the specific display simply has no effect - using the touchscreen will move the pointer regardless which monitor it is on.

Here's the config:

image

If there's any further info/logs I can provide, just tell me how and I'll get it ASAP

dylanvorster commented 7 months ago

I also happen to have a touch screen monitor, I will try take a look this weekend. it might have to do with pointer device code I'm checking for 🤔

fonix232 commented 7 months ago

Thanks Dylan!

Is there anything I can do to debug things on my end and provide some information?

fonix232 commented 7 months ago

One peculiar thing I noticed is that after a fresh start of Dynamouse, the "move the mouse pointer to the selected display" logic works, but just once. If I e.g. use my Magic Trackpad to move it to a different monitor, another touch event on my touchscreen will control the mouse pointer wherever it is (so, on the other monitor).

dylanvorster commented 7 months ago

I may have a fix for this on my latest PR, just need to test a bit on my end

dylanvorster commented 7 months ago

i fixed a few issues when Dynamouse would boot automatically on startup + I added the ability to configure an initial delay before it starts monitoring events (I found this to be a bit useful in complex setups such as mine where I have many many usb devices connected to my music workstation).

fonix232 commented 7 months ago

@dylanvorster updated to the latest version, and I'm seeing the same - first event will properly jump the mouse pointer to the touchscreen, but any further touches will not, and just move the pointer around on whichever screen it was previously.

dylanvorster commented 7 months ago

just want to double check:

I know this is a bit finicky at the moment, im trying to find better ways of dealing with this, the latest version at least only requires the accessibility permissions and no longer requires the input monitoring permission

dylanvorster commented 7 months ago

Can I suggest removing all instances of the software (permissions and startup items), restarting and then re-installing the new version? (you may have done this already, apologies if you have)

dylanvorster commented 7 months ago

Did a new release that fixed some HID device selection logic, this might further solve your problem (I hope)

dylanvorster commented 7 months ago

I did discover that there is a usage type within the USB spec called 'pointer' in conjunction to the 'mouse' identifier, if it still doesnt work for you, I can try add that to the filtering capability

fonix232 commented 7 months ago

Apologies for the late reply, have been fighting a nasty ear infection and had no chance to test things further.

I did remove all permissions and the old version of the app before installing the new one - permissions were a bit buggy (the app got stuck in "loading..." even though permissions were granted and I needed to restart it a few times), but otherwise the update was successful.

Let me try with the latest version!

fonix232 commented 7 months ago

Whelp, no luck. 1.1.0 installed, confirmed working (debug logging appeared, and I've managed to take a look at the logs as well), but alas, still the only time it works is the first time I touch the touchscreen after relaunching DynaMouse.

I'd recommend you add some more logging options, such as timestamp, as well as more log entries (for example the whole flow logic of: 1, detecting an input from a filtered device 2, checking pointer location 3, moving pointer to new position on selected display - or if not moving it there, an explanation as to why).

From the logs, what I'm seeing is that the moment another input is used (in my case, my Magic Trackpad), the listener for the touchscreen events gets disabled, which is why this behaviour occurs:

{"level":"info","message":"Refreshing device list","namespace":"POINTERS"}
{"level":"debug","message":"Re-initializing","namespace":"ROBOT"}
{"level":"info","message":"Connecting","namespace":"TouchScreen"}
{"devices":{"TouchScreen":{"display":"G34WQC"}},"level":"debug","logFile":true,"message":"Config updated","namespace":"CONFIG"}
{"level":"debug","message":"Re-initializing","namespace":"ROBOT"}
{"level":"info","message":"Disconnecting","namespace":"TouchScreen"}
{"level":"info","message":"Connecting","namespace":"TouchScreen"}
{"devices":{"TouchScreen":{"display":" ZZX-FHD-HDR"}},"level":"debug","logFile":true,"message":"Config updated","namespace":"CONFIG"}
{"level":"debug","message":"Re-initializing","namespace":"ROBOT"}
{"level":"info","message":"Disconnecting","namespace":"TouchScreen"}
{"level":"info","message":"Connecting","namespace":"TouchScreen"}
{"level":"debug","message":"Device detached","namespace":"POINTERS"}
{"level":"info","message":"Refreshing device list","namespace":"POINTERS"}
{"level":"info","message":"Detaching","namespace":"DSV2Pro TKL"}
{"level":"debug","message":"Re-initializing","namespace":"ROBOT"}
{"level":"info","message":"Disconnecting","namespace":"TouchScreen"}
{"level":"info","message":"Connecting","namespace":"TouchScreen"}
{"level":"debug","message":"Activating: TouchScreen","namespace":"ROBOT"}
{"level":"info","message":"Disconnecting","namespace":"TouchScreen"}
{"devices":{"TouchScreen":{"display":" ZZX-FHD-HDR"}},"level":"debug","logFile":false,"message":"Config updated","namespace":"CONFIG"}
{"devices":{"TouchScreen":{"display":" ZZX-FHD-HDR"}},"level":"debug","logFile":true,"message":"Config updated","namespace":"CONFIG"}
{"level":"debug","message":"Disposing app"}
{"level":"info","message":"Refreshing device list","namespace":"POINTERS"}
{"level":"debug","message":"Re-initializing","namespace":"ROBOT"}
{"level":"info","message":"Connecting","namespace":"TouchScreen"}
{"level":"debug","message":"Activating: TouchScreen","namespace":"ROBOT"}
{"level":"info","message":"Disconnecting","namespace":"TouchScreen"}

Oh, also, you might want to normalise the input and display names, see e.g.:

{"devices":{"TouchScreen":{"display":" ZZX-FHD-HDR"}},"level":"debug","logFile":true,"message":"Config updated","namespace":"CONFIG"}

Note how the display value has a whitespace before the actual name.