sailfish-on-fxtecpro1/droid-config-t5

Enable support for external mouse

Opened this issue · 6 comments

USB mice are partly supported¹ when adding -plugin evdevmouse at the end of the LIPSTICK_OPTIONS: line in /var/lib/environment/compositor/droid-hal-device.conf. Since external keyboards already work out of the box, this could get very useful for desktop applications and DEs run using @elros34's sailfish_linux_chroot or @r3vn's harbour-containers, especially if we can get working HDMI out one day (there's hope, @elros34 made it work on the PhotonQ a few years ago, and I can confirm HDMI monitors are detected in logcat).

Are there any drawbacks for this change or is it safe to add this option in the file by default?

¹ : mouse support is only partial for now, but hopefully this can be improved later:

  • the cursor is not visible,
  • the mouse doesn't take landscape rotation into account, it will always behave as if the phone was in portrait,
  • and not all native SFOS apps fully support it: the native media player will for instance react to mouse input only in the playback view, not in the file browser screen.

When i was reading about it in past the cursor is not visible cause coursor icon is missing so you might want to look into that

Definitely something I wanted to try yup, that'd be cool if this could be easily fixed by just adding icons. Rotation may be a bigger issue though.

Rotation might be tough to fix

@elros34 has been busy:

  • Cursor visibility
  • Cursor automatically hiding when tapping on the screen
  • Dynamic orientation

He made this as a Lipstick patch for Patchmanager3, and rotation is taken care of by a qt5 plugin. I don't know yet if the packages are ready to be shared or are still WIP, but you can find them on OBS and on his Github profile.

The limitations for external mouse are now cleared on SFOS provided those two packages are installed, so the question remains as to whether it's worth adding -plugin evdevmouse at the end of the LIPSTICK_OPTIONS: line in /var/lib/environment/compositor/droid-hal-device.conf. This could be done by users when they need it and install Elros' packages too, but if there's no drawback, could be default.

I think we should add it, it doesn't hurt

For the record, someone has been asking how to do it just now on IRC so I'll just paste the instructions here too in case others need them:

10:03 Kabouik: Oksana, spiiroin, things have changed a few days ago because elros34 has been working on packages and
patches to improve that. You can now see a cursor and its orientation is dynamic if you install a qt5 plugin (else  
it's just working in portrait). Gimme a second for the links.                                                       
10:05 Kabouik: First, you need to edit a configuration file to enable mouse support:                                
https://github.com/sailfish-on-fxtecpro1/droid-config-t5/pull/44/commits/33e54fb7efc23fdf14f3220cf80f240f638b3763   
(just add the -plugin evdevmouse at the end of the line)                                                            
10:06 Kabouik: Then you need this for dynamic orientation of the mouse coordinates:                                 
https://github.com/elros34/qtbase/releases/tag/0.0.2 (install with zypper in and chose "Break dependencies" when    
prompted)                                                                                                           
Kabouik: And finally you need this to show the cursor:                                                               
https://build.sailfishos.org/package/binary/home:elros34:sailfish-devel/mousetracker?arch=armv8el&filename=mousetrack
er-0.0.1%2Bmaster.20200823215836.5063c85-1.4.1.jolla.armv7hl.rpm&repository=sailfishos_3.3.0.16                      
10:07 Kabouik: The last one is a patch, so you install the RPM, and then you go enable it in Patchmanager3. Restart  
Lipstick, done.                                                                                                      
Kabouik: The cursor will show when a mouse is detected. Mouse wheel click toggles events/cover views. The cursor goes away 
if you tap on the screen with the finger.                                                                            
Kabouik: There's no drawback to having all this installed as far as I know.