virresh / matvt

Virtual Mouse for Android TV that can be controlled via remote itself.
GNU General Public License v3.0
227 stars 36 forks source link

Add option of delay when disabling the boss key #69

Open joao-pinhal opened 1 year ago

joao-pinhal commented 1 year ago

Hi, I have a Mi Stick and the only reasonable option for a boss key is the app drawer button. It works fine when enabling the mouse mode and scroll mode. However, when I disable it, it returns to the main menu, which is extremely frustrating. I wanted to see if there is a way of adding an option to add a timer of like 500ms after disabling mouse mode where the key press does not activate its original function (which already happens when scroll mode is turned on/off).

I think the fix would be adding a timer on line 294 of https://github.com/virresh/matvt/blob/master/app/src/main/java/io/github/virresh/matvt/engine/impl/MouseEmulationEngine.java. I was ready to try to fix it myself, but I have no space in my C: drive, so no Java SDK for me :). I might also be wrong about this, since my experience with Java/Android is limited.

It would be great if someone could make this work. Thank you.

MailYouLater commented 1 year ago

Would you be willing to try the mod @damiano94 posted in #36 which is stated to include a fix for this issue?

In case you're wary of using a third-party modded version, I have analyzed the modified APK, and I can state with a fairly high degree of confidence that the only changes are the stated ones which disable the 'info' button and fix this issue, and the fact that it had to be resigned, and they used a debug key to do so. I've been meaning to try to backport the mod into the original source code so it can be included in the main release, but haven't taken the time to get it all figured out yet. If you do try it, please post back here to let us know if it does our does not work for you. Thanks.

joao-pinhal commented 1 year ago

Wow, it actually works! Thank you for pointing me there. Anyway, I think this should be in the main release.

MailYouLater commented 1 year ago

Agreed. I intend to figure out how to backport the mod to source that can be used in the main release, but I'm not particularly experienced in such things, so IDK if/when I'll be able to, so if someone else is able to do it first that would actually be really cool.

virresh commented 1 year ago

Thanks, I think it's useful to disable info button. I'd asked the mod author if they're fine with adding this to the main release. They haven't replied for quite sometime now.

There are multiple improvements by another generous soul in the form of a PR, will add this along with them.