virresh / matvt

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

Option to remap or disable info button. #36

Open damiano94 opened 2 years ago

damiano94 commented 2 years ago

On my sony tv info button is very important and I need it. For now I Just can't use this app because when I Press info button it triggers mouse. I would want to completely disable additional buttons and use only boss key.

damiano94 commented 2 years ago

Ok I fixed it. Firstly if it's against rules delete my message. I used apktool to decompile latest version and edited smali code directly (it was faster than setting up whole build environment, i'm not programmer and i'm not developing for android). Apk is signed with signapk.jar. I disabled info button completely, now only boss key can toogle mouse cursor (default long press but you can change this to short press in app settings). Another mod: previously when you switched back to dpad mode by holding boss key after releasing boss key default button action was executed which was anoying. For example I mapped boss key on my MI Box S to app button (that one with nine squares icon), everytime when I switched back to dpad mode after releasing app button, list of all apps was showing and I need to press back button everytime after switching to dpad mode. I don't know if problem existed only with long press boss key or both long and short press, but my mod fixed it for long press (short press not tested). I added CountDownTimer, it starts when switching to dpad mode and before it is finishing I return true in "public boolean perform (KeyEvent keyEvent)" so key event is not consumed by system. As soon as CountDownTimer finishes I return false in "public boolean perform (KeyEvent keyEvent)" just like it is by default.

Here is apk file: https://drive.google.com/drive/folders/12JRGUFOyfbLW6rLwc8iVFK74Lb_8BA7G?usp=sharing I also included MouseEmulationEngine.smali and MouseEmulationEngine$6.smali files so it's still opensource. MouseEmulationEngine.smali was modified, MouseEmulationEngine$6.smali is added.

I posted this mod only here, it was tested on my sony android tv and mibox s, looks like everything works like a charm, but keep it mind that it can be bugged! I do not take any responsibilty for using my mod!

Enjoy!

virresh commented 2 years ago

Thanks @damiano94 Mods are perfectly fine and are welcome!

Also, just for completeness, you do not need to install Android Studio, you just need to download Android SDK and Java JDK to build the source code via Command Prompt. You can use any text editor to edit the source files (including Notepad / VSCode / Sublime Text / Notepad++ / Any other that you like).

Also thanks for the information on changes done. If you get time to edit the source files and would like to experiment a bit, I'd be more than happy to help get your patch as a commit and merge it in the repository 😄

tech1e-guy commented 1 year ago

Thanks @damiano94 I wanted to disable info button permanently.