How to properly remap 3rd party select buttons - Fire TV Q&A, Help & Troubleshooting

**Update**
Added a filter for hulu only because this was causing double data entry in almost every other app.. you can also add a pipe for additional applications that need this fix.
For anyone wondering why not use "Xposed Edge" instead? Well I tried just now and there's a severe delay in emitting keyevent 23 when done via root or it is not accepted at all by hulu if it is not done on the su level sending it over shell. So either way it falls apart. Button Mapper appears to be best solution for the Enter key to become select in specific apps.
Code:
grep -E 'mCurrentFocus.*(hulu|dream|otherAppNameHere)' > /dev/null 2>&1 && /system/bin/input keyevent 23
So I recently came across a pretty awesome little remote from Amazon, the Rii MX8 Air mouse remote.
https://smile.amazon.com/gp/product/B07MHKMQ7J
Only problem was that some apps, particularly hulu, don't care for the enter key and only want to operate with the dpad_center or keycode 23. Remapping this key in the various button remappers don't work well unless it can execute an adb shell command and even then.. you better be rooted and be able to run that command as the shell user (at least for the case of Hulu).
Here is how I managed to do it. If you know of other ways then please share as this application does require that you purchase it for the pro features - adb shell commands.
https://play.google.com/store/apps/details?id=flar2.homebutton&hl=en_US
# Install Button Remapper
# Set Accessibility
adb shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
adb shell settings put secure enabled_accessibility_services flar2.homebutton/flar2.homebutton.a.ai
adb shell settings put secure accessibility_enabled 1
# Add Button
# Remap Enter (66) to DPAD_Center (23)
# Single tap
su shell -c "dumpsys window windows | grep -E 'mCurrentFocus.*(hulu|dream)' > /dev/null 2>&1 && /system/bin/input keyevent 23"
If typing all that in looks daunting then just get to the text field and then do this over adb.
adb shell input text "string%sof%stext%sbelongs here"
ex.
Code:
adb shell input text "su%sshell%s-c%s\"dumpsys%swindow%swindows%s|%sgrep%s-E%s'mCurrentFocus.*(hulu|dream)'%s>%s/dev/null%s2>&1%s&&%s/system/bin/input%skeyevent%s23\""
You can also script it just fine via this method.
https://android.stackexchange.com/q...ble-to-write-to-a-devices-clipboard-using-adb

Just remember those WFD remote are Wifi magnets. I have just a few devices on Wifi and Ive been through several of those remotes. The remote alone killed my range, connection quality, etc. Just a heads up.
CEC is the way to go IMO. The new Roku TVs all have a secret menu that enable full CEC control that controls the FS\FTV fully.

TimmyP said:
Just remember those WFD remote are Wifi magnets. I have just a few devices on Wifi and Ive been through several of those remotes. The remote alone killed my range, connection quality, etc. Just a heads up.
CEC is the way to go IMO. The new Roku TVs all have a secret menu that enable full CEC control that controls the FS\FTV fully.
Click to expand...
Click to collapse
Unless I missed something, and I doubt that I have given the sheer amount of time I have spent on this, the RokuTV with CEC enabled via hidden menu is next to useless. The back button and home button collide with the device itself - there's no intelligence built in to prevent it from interacting and doing what it would normally do for the RokuTV itself. That would also be expected because otherwise you'd get stuck inside your hdmi device.
Personally I have not been experiencing any wireless interference with this remote and given the amount of wifi I am actually around atm I'd say that is fairly impressive. That is not to say I am not interfering with a neighbor in reality, but my 2.4 and 5ghz networks appear to be operating fine.
In fact I had to switch my TV over from 5ghz to 2.4ghz because 2.4ghz penetrates walls better, this device is 2.4ghz as well but I am sure it is in a frequency that is outside the wifi range.

glitchbit said:
Unless I missed something, and I doubt that I have given the sheer amount of time I have spent on this, the RokuTV with CEC enabled via hidden menu is next to useless. The back button and home button collide with the device itself - there's no intelligence built in to prevent it from interacting and doing what it would normally do for the RokuTV itself. That would also be expected because otherwise you'd get stuck inside your hdmi device.
Personally I have not been experiencing any wireless interference with this remote and given the amount of wifi I am actually around atm I'd say that is fairly impressive. That is not to say I am not interfering with a neighbor in reality, but my 2.4 and 5ghz networks appear to be operating fine.
In fact I had to switch my TV over from 5ghz to 2.4ghz because 2.4ghz penetrates walls better, this device is 2.4ghz as well but I am sure it is in a frequency that is outside the wifi range.
Click to expand...
Click to collapse
Home button is only for the TV to return to its home. There is no CEC home button.
Back button works absolutely perfectly via IR. Not a single problem. Done this on 2 TCLs and one Hisense.
The menu Im talking about is Home 5x rw,down,ff,down,rw.
I dont know where you got that idea of the devices colliding, they just limit CEC functionality on these TVs to keep people away from the ability to add and fully operate the TV and FS without ever going into the TV itself.

Update: Ignore this musing, the hulu app does not experience any further issue with the command mentioned in the first post. There is a potential for other apps to misbehave if it listens to both Enter and Select, but given the filter you'd have to add it to the command before finding out and even then there appears to be ways to mitigate the issue if it occurs.
--------------------------------------------
I may need to revise this more still & add in a filter to detect either a soft keyboard or text input field. I suspect the above fix may still result in double entry in the Hulu app.
This really needs to be fixed in the Button Mapper app as double input on that key shouldn’t happen if it’s remapping correctly, but being android inconsistency always abound.
adb shell dumpsys window InputMethod | grep "mHasSurface"
https://stackoverflow.com/questions...-keyboard-is-visible-on-android-device-or-not

TimmyP said:
Home button is only for the TV to return to its home. There is no CEC menu button.
Back button works absolutely perfectly via IR. Not a single problem. Done this on 2 TCLs and one Hisense.
The menu Im talking about is Home 5x rw,down,ff,down,rw.
I dont know where you got that idea of the devices colliding, they just limit CEC functionality on these TVs to keep people away from the ability to add and fully operate the TV and FS without ever going into the TV itself.
Click to expand...
Click to collapse
I own 2 RokuTVs myself, sold one of them due to a move, but I really do like them tbh. Where I got the idea was from personal experience. The home button kicks me out to the home screen any time it is used (Initially w/ a 5 second delay before going back in - now it just sits there), the select button shows the input I am on overlaid on the bottom half & the select button also kicks me out to the home screen w/ my hdmi input device highlighted.
The feature is hidden because it naturally collides.. maybe they fixed it in your version & I need to update mine, but in my current version it’s completely unusable when it’s fully enabled via the hidden menu. And I know what menu you’re talking about - we’re on the same page - it just doesn’t work on my RokuTV.

Related

[Q] KODI Issue

This is a user problem I realize but recently after letting my kids use KODI on the FireTV I know have a persistent readout of menus, associated xml files, and mouse movements on the top of my screen. Example: Window: fullscreenvideo (VideoFullScreen.xml) Mouse: (0,0). Obviously this changes as I change menus, video modes, etc. I'm guessing there's some key combination to enable/disable this but it seems like I've tried every button without any luck. I do have a keyboard as well should that make it easier to explain how to turn it off. Any assistance would be appreciated. Thanks and Happy New Year!
apparently i had to turn off debugging in the addon.xml file for the skin. Thanks.

FireTV not responding to keyboard commands

My niece has a Fire TV box that worked well until she moved recently. She lost her remote in the move, and went from a hard-wired ethernet to wireless connection (no idea if that matters). I told her that she could use a keyboard to navigate from the home screen (which wouldn't fully load because she doesn't have an internet connection) and set up her wireless connection using the keyboard, and then from that point she could use her smartphone to control the FireTV. The only problem is that she cannot get her external, wired keyboard to respond on the FireTV. Thinking she was just doing something simple incorrectly, I brought her FireTV to my house (I have one as well) and I plugged it in at my place. I have wired internet, and so the home screen did load at that point, but I tried my wired keyboard and I also could not get it to respond. I would just give her my remote and use my phone to control ours, but I can't get to any screen where I could program my remote to work with hers.
Any suggestions? I think it's pretty unlikely that both wired keyboards are bad, and although I don't think she's ever used the USB port I would think it's pretty unlikely that the port is bad too. Is there a way to do a factory reset without actually having a remote or keyboard?
Thanks!
Try an active USB hub between the keyboard and the aTV. Probably the wired keyboards do need more power (or to much for the aTV) in comparision with a wireless keyboard. If the keyboard is illuminated try switching the lights off to minimize the power consumption.
Calibaan said:
Try an active USB hub between the keyboard and the aTV. Probably the wired keyboards do need more power (or to much for the aTV) in comparision with a wireless keyboard. If the keyboard is illuminated try switching the lights off to minimize the power consumption.
Click to expand...
Click to collapse
Wow, hadn't thought about that...I'll do that; thanks!
clb4g9 said:
Wow, hadn't thought about that...I'll do that; thanks!
Click to expand...
Click to collapse
OK, I think I figured out the issue, but still not sure how I'll fix it. I couldn't get the keyboard to work with my Fire TV also, so I started playing around, and it looks like under Settings/Developer Options/USB debugging it was selected as "on". When I selected "off" the keyboard started working without any extra hubs or anything of the sort.
So here's my issue; how the heck do I get to the "USB Debugging" screen to turn this off without a keyboard or remote? I can't seem to work through that in my head unless there's a way to do a factory reset without a keyboard/remote/smartphone, set up my remote to work with hers, disable usb debugging and then give it back to her and then re-set the remote to work with my firetv. Thoughts?
I figured out a workaround, as shown here:
http://www.aftvnews.com/how-to-remotely-control-an-amazon-fire-tv-or-fire-tv-stick-via-adb/
Luckily for me I had a hard-wired ethernet connection and adb debugging was enabled so I was able to figure out the IP address of the Fire TV and adb connect into it using my laptop, and then, very slowly, use the adb commands to scroll down and disable the "USB debugging" so that a keyboard would work. From here I think (hope) she can use a keyboard to set up her wireless network and then from there she can use her smartphone as a remote.
Learn something new every day!

settings list

Is there a command I can run in adb-shell or a terminal that will output a list of all the settings which aren't in the GUI menu but can still be manipulated with the "settings put" command? Like "captive_portal_detection_enabled" or "captive_portal_server" for example. Or is there a file somewhere in the rom that lists them all?
At the moment I'm most interested in disabling whatever network-connectivity check is happening for me on mobile data, with AFWall enabled I'm getting a little x on my mobile data icon.
The other thing I'm interested in looking for is a way to completely disable the safe volume warning and anything/everything to do with it.
And in general I would enjoy taking a look at what's available to mess up the rom with.
edit:
I managed to find these lists, only there's nothing about captive portals or volume listed in any of them that I can see. Not sure my little x on the mobile data is the same as captive portal detection for wifi though. Search box on these pages doesn't yield much either (because I don't know what I'm looking for most likely).
https://developer.android.com/reference/android/provider/Settings.Secure.html
https://developer.android.com/reference/android/provider/Settings.Global.html
https://developer.android.com/reference/android/provider/Settings.System.html
edit:
I *think* I've found the safe volume setting - "config_safe_media_volume_enabled" - out of the description of an old xposed module, which calls it a "system parameter" so I ran "settings put system config_safe_media_volume_enabled false" in adb shell. Headphone volume is still initially set to around 75% after reboots, but I've been blasting some loud Venetian Snares breakcore at 100% volume with GoneMad's preamp maxed out and I don't seem to have triggered the popup yet. Not sure though, the xposed module's description says it sets the parameter at boot and the one I set seemed to survive a reboot (it was "null" before I set it to false). Time will tell, I get that damn popup at least a few times a week.

Buttons Backlight control

Hi everybody. I'm a newbie with digging deeper into my device. I'm looking for a solution to control buttons backlight. Since P600 doesn't have led for notifications, I'm interested in using hardware buttons for this purpose. Especially I would like to have backlight while I'm connecting the device to the charger. I hate the screen lighten up (especially at night time) when I plug it in, so I disabled this feature, but it disabled hw buttons backlight as well. It happened to me few times that I plugged in the device and I thought it is charging, but I was wrong and I ended up with discharged tablet at the morning ? I have searched through the Internet and found some clues, but nothing worked for me. I tried some apps and even played with Tasker, but since I'm a beginner, I wasn't able to succeed... So I would appreciate any help My device operates on LineageOS 14.1 and is rooted by Magisk
It seems that I figured it out by myself ? I digged bit more into Tasker app, I watched some tutorials and read about running shell commands. Overall it's a quite complicated subject, but for basic purposes it's comprehensible even for me It's all come down to locating proper "brightness" file which is responsible for lighten up capacitive buttons. In case of this device I found it in a different location than in most other devices. Then using Tasker (you need to be familiar with basic operations at least and you need to have root) I set some simple commands to trigger buttons backlight when I plug the device in (I attached a screenshot). I haven't tested other applications of this feature yet, but I belive it could be used in a similar way for other purposes as well.
I described my experiences because maybe somebody would be willing to take advantage of this ?
EDIT: Something went wrong with loading the image so I'm writing commands to run with Tasker:
1. Run shell
Command echo 1 > /sys/devices/virtual/sec/sec_touchkey/brightness
2. Wait
2 seconds
3. Run shell
Command: echo 0 > /sys/devices/virtual/sec/sec_touchkey/brightness
And you have to check "Use root"

Q: How to start Screensaver activity on rooted Firestick

I'm trying to start the screensaver service with a remote press using 'X edge Pro' on a rooted Firestick.
Can't find the activity that starts the screensaver?
Basically I want to hold down a button to start the screensaver.
Currently the only way I've found is to point to Aerial Dream and start the 'Test Activity'
If anyone knows a way I can do this your help would be greatly appreciated.
You can launch whatever screensaver you currently have active with this:
Code:
ADB shell input keyevent KEYCODE_SOFT_SLEEP
It's case sensitive
Finnzz said:
You can launch whatever screensaver you currently have active with this:
Code:
ADB shell input keyevent KEYCODE_SOFT_SLEEP
It's case sensitive
Click to expand...
Click to collapse
Amazing, thankyou.
Rather than using the ADB command, I found X Edge Pro has a 'inject key event'. I found the KEYCODE_SOFT_SLEEP there.
Thankyou for you swift reply. Really helped

Categories

Resources