Why do you have a rooted device? - Shield Android TV Q&A, Help & Troubleshooting

I want to know why you are using a rooted device

YouTube Vanced. My two year old gets board with the adds and wanders off.
I use the normal YouTube app most of the time for myself when watching subscribed channels.

Seems that this is the most reasons: Ads

I rooted to have full playstore so that i didnt have to sideload
I rooted to use apps like droidmote
I rooted to flash custom roms I just dont like the limited android tv os

Ridding yourself of ads is definitely a good reason, but I mainly rooted so I could edit the key layout (.kl) files for specific remotes.
For example, I am using a Fire TV remote on my Shield. By default it has BACK, MENU, HOME, PLAY/PAUSE, REWIND, FAST FORWARD buttons.
I personally don't care about FF/RW buttons, so by modifying the key layout file, I've made it so that those buttons do volume up/volume down instead. Works beautifully.
This can also be achieved by a 3rd party app that will re-map your keys,, but being rooted I can edit the file directly without any limitations. Also not having to rely on another app is nice.

bubbablacksmith said:
Ridding yourself of ads is definitely a good reason, but I mainly rooted so I could edit the key layout (.kl) files for specific remotes.
For example, I am using a Fire TV remote on my Shield. By default it has BACK, MENU, HOME, PLAY/PAUSE, REWIND, FAST FORWARD buttons.
I personally don't care about FF/RW buttons, so by modifying the key layout file, I've made it so that those buttons do volume up/volume down instead. Works beautifully.
This can also be achieved by a 3rd party app that will re-map your keys,, but being rooted I can edit the file directly without any limitations. Also not having to rely on another app is nice.
Click to expand...
Click to collapse
Can you explain how to do edit the .kl file to get the volume working? Thank you

BRICK0044 said:
Can you explain how to do edit the .kl file to get the volume working? Thank you
Click to expand...
Click to collapse
The files are located in /system/usr/keylayout
You just need to find and open the .kl file that is used by the remote/controller you have plugged in.
In my case, the Fire TV Voice Remote (WiFi) I'm using uses the file Vendor_1949_Product_0407.kl
All I have to do is open that file up in a text editor and make the changes I want.
By default you would see:
key 168 MEDIA_REWIND
key 208 MEDIA_FAST_FORWARD
So since I want volume control for those buttons instead, I edit it to look like :
key 168 VOLUME_DOWN
key 208 VOLUME_UP
Save and reboot.
Now the rewind/fast forward buttons on the remote act as volume control.

Thank you

Related

Satechi Media Remote

So I got my Nexus 7, and think its awesome! I got mine so I can install it in the dashboard of my car to use as media player/navigation, all that good stuff.
I thought it would be great to use a bluetooth media remote attached to the steering wheel to control basic functions. I purchased the Satechi Media Remote, and for the most part it works perfect! There is only one main issue and one minor issue.
Main Issue:
The remote has a button on the bottom middle that has a square on it. It works just like pushing the Home button.
While it is in my dashboard, it will be rare that I need to go to the actual home screen, and instead i would like it to take me to the car dock app I use. I have been trying many things to get it to work and I can not get it to function as anything else!
I tried using the app "External Keyboard Helper" and it worked for remapping the other 2 lower buttons on the remote (which is part of question 2), but I can not get it to remap the middle button. When I use the degugger in External keyboard helper, if I push that button it doesnt log the keypress and goes to the home screen like it is supposed to. I tried manually setting the keycode (102) to run an app and it still just goes to the home screen.
The next thing I tried was to edit the actual keylayout files like what is outlined here:
http://forum.xda-developers.com/showthread.php?t=695936
Doing it this way I can not seem to get it to change any of the three buttons to anything else. At first I couldnt figure out which .kl file to edit, so I searched and replaced all instances of HOME and MOVE_HOME in all the files, and moved them back to the device, still no change.
Do I need to make a cutom .kl with the vendor name and id in the title?
Where do I get that information from?
I tried editing the file Vendor_05ac_Product_0239.kl since in its comments it says its for a "Apple Wireless Keyboard", which this device is supposed to emulate to work with ipods/ipads, still nothing.
I am at my witts end trying to find the right way to remap this one button on this little remote hahaha
The second issue which is very minor, which might not be solved in here. I want to map one of those other lower buttons to google voice search. When I run the setup for "External Keyboard Helper" it has a section for mapping the running of an app to a key, which worked for car dock and a car music player. The problem is, when I go to the Application shortcuts portion of the app, the only thing I see listed in there is "com.google.android.voicesearch". If I set that as the app to run when I press a key I see this..
"com.google.android.voicesearch is not installed"
Is there a way to launch google voice search without having to click on the microphone in the search bar?
I got the thing working! I had to make a new KL file for the "keyboard"
I found this thread that told me how to get the vendor and product id, that seemed to be what was missing.
http://www.thriveforums.org/forum/toshiba-thrive-development/9626-how-create-customized-keylayout-any-usb-bluetooth-keyboard-rooted.html
The file name needs to match those.. its information is
Vendor ID 05ac
Product ID 023c
so the kl file is named
Vendor_05ac_Product_023c.kl
The scan codes for the three lower buttons are
161 (bottom left with the keyboard logo)
172 (middle bottom with the square)
113 (bottom right with the mute logo)
I changed the one for the bottom middle to SEARCH, and from that point on I could remap the key with the app External Keyboard Helper.
Next thing I need to do is figure out how to run a app from a keypress without using that remapper.. and how to start google search from a keypress
ShreddinPB said:
I got the thing working! I had to make a new KL file for the "keyboard"
I found this thread that told me how to get the vendor and product id, that seemed to be what was missing.
http://www.thriveforums.org/forum/toshiba-thrive-development/9626-how-create-customized-keylayout-any-usb-bluetooth-keyboard-rooted.html
The file name needs to match those.. its information is
Vendor ID 05ac
Product ID 023c
so the kl file is named
Vendor_05ac_Product_023c.kl
The scan codes for the three lower buttons are
161 (bottom left with the keyboard logo)
172 (middle bottom with the square)
113 (bottom right with the mute logo)
I changed the one for the bottom middle to SEARCH, and from that point on I could remap the key with the app External Keyboard Helper.
Next thing I need to do is figure out how to run a app from a keypress without using that remapper.. and how to start google search from a keypress
Click to expand...
Click to collapse
have you made any progress on this? i'm interested in this as well...
I got one of these remotes as well to use as a music/gps remote in my vehicle mounted Nexus 7. It works well, but let's hope a smart developer will make a better "external keyboard helper".
Hi can someone share his .kl file.
The Satechi device doesn't work at all with my MK888b box.
Interesting in this too
Sent from my Nexus 5 using XDA Premium 4 mobile app
Know this is an old post, but this helped me immensely. Got a Satechi remote and this quick tutorial helped me a ton. Seemed a little pain in the ass-ish at first, but realistically only took 5 minutes to get situated. Now to figure out how to bind a key to a specific app.
You probably don't even have this device anymore, if you change the keycode for whatever button you want to have open Google search to look like
key XXX VOICE_ASSIST
It'll open up Google voice search for you.

[Q] Keyboard keys for Back and Home

I am trying to setup my Flirc with the Nexus Player, for both native NP keys and the full spectrum of XBMC/kodi keys. I have all of the kodi keys working properly and the UP, DOWN, LEFT, RIGHT, SELECT and PLAY/PAUSE buttons work just fine on the main Nexus Player interface. However, the mapped BACK and MENU keys are not working. For those that don't know, a Flirc USB devices presents itself as a standard keyboard to the Nexus Player and can be programmed on your PC to learn remote control commands to activate specific generic keyboard combinations.
If anyone has a standard keyboard hooked up to their NP either via Blutooth or USB OTG, can you tell me which keys correspond to the BACK and HOME functions on the Nexus Player or if those functions are working at all on your keyboard?
Thanks.
Elrondolio said:
I am trying to setup my Flirc with the Nexus Player, for both native NP keys and the full spectrum of XBMC/kodi keys. I have all of the kodi keys working properly and the UP, DOWN, LEFT, RIGHT, SELECT and PLAY/PAUSE buttons work just fine on the main Nexus Player interface. However, the mapped BACK and MENU keys are not working. For those that don't know, a Flirc USB devices presents itself as a standard keyboard to the Nexus Player and can be programmed on your PC to learn remote control commands to activate specific generic keyboard combinations.
If anyone has a standard keyboard hooked up to their NP either via Blutooth or USB OTG, can you tell me which keys correspond to the BACK and HOME functions on the Nexus Player or if those functions are working at all on your keyboard?
Thanks.
Click to expand...
Click to collapse
I haven't tested this yet, but typically the Windows key + ESC = HOME (or, depending, sometimes the HOME key itself on a keyboard). BACK is typically the ESC key by itself.
My FLIRC arrived yesterday -- just haven't configured it yet. I'll give it a whirl and get back to you!
PearcePowers said:
I haven't tested this yet, but typically the Windows key + ESC = HOME (or, depending, sometimes the HOME key itself on a keyboard). BACK is typically the ESC key by itself.
My FLIRC arrived yesterday -- just haven't configured it yet. I'll give it a whirl and get back to you!
Click to expand...
Click to collapse
Thank you. I got the back key working correctly (and, in the NP, it is indeed ESC), but you'll have to go in to XBMC/kodi and add in the keymapper in programs then globally change ESC to be BACKSPACE and BACKSPACE to be ESC. Otherwise the NP back key would be "previous menu" in kodi. Make sure to update your Flirc with the full keyboard template to change the ESC key to your remote button you wish. Once done, both the NP and kodi see ESC as the back key.
I still haven't figured out the HOME key yet... I have a "HOME" special button atop my wireless keyboard that works, but I can't scancode it properly so I'm not sure what it is yet (I've read it may be scancode 57, but thats normally "space", so not sure and haven't tested it yet) I'll see if WIN+ESC works from my keyboard when I get home tomorrow. Hope to hear your experiences as well... thanks.
Elrondolio said:
I'll see if WIN+ESC works from my keyboard when I get home tomorrow. Hope to hear your experiences as well... thanks.
Click to expand...
Click to collapse
I tested the following three keyboard commands -- WIN + ESC, ALT + ESC, and HOME -- and none work in the Nexus Player to take you home. Grr. I've got everything working but the HOME key as well.
PearcePowers said:
I tested the following three keyboard commands -- WIN + ESC, ALT + ESC, and HOME -- and none work in the Nexus Player to take you home. Grr. I've got everything working but the HOME key as well.
Click to expand...
Click to collapse
There is a topic about this over on the Flirc forums that you may want to follow:
http://forum.flirc.tv/index.php?/topic/1219-flirc-and-android-tv-adt-1/
I have a wireless keyboard that has extra media keys including a Home key (not the regular Home, End, etc). It works just like the Home key on the NP remote. I'm not at home right now, but had hooked it up to one of my laptops and that special Home key sends key code 172.
We just need to figure out how to teach Flirc that key code then map one of our remote buttons to that key.
Elrondolio said:
There is a topic about this over on the Flirc forums that you may want to follow:
http://forum.flirc.tv/index.php?/topic/1219-flirc-and-android-tv-adt-1/
I have a wireless keyboard that has extra media keys including a Home key (not the regular Home, End, etc). It works just like the Home key on the NP remote. I'm not at home right now, but had hooked it up to one of my laptops and that special Home key sends key code 172.
We just need to figure out how to teach Flirc that key code then map one of our remote buttons to that key.
Click to expand...
Click to collapse
Any luck with the home key and Flirc? I noticed no one has responded over in the Flirc forums yet.
PearcePowers said:
Any luck with the home key and Flirc? I noticed no one has responded over in the Flirc forums yet.
Click to expand...
Click to collapse
Not as yet. It seems more complicated than I first thought... the record_api function of flirc_util.exe can map HID commands to remote control buttons, but finding the correct HID for "Home" is difficult. There are thousands of HID commands as referenced in this document:
http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
We're looking at the ones in the Consumer Page starting on page 75. There is a special modifier in the second argument of Firc's record_api, 102, that supposedly tells the Flirc to reference that Consumer Page, but finding the "Home" key for the first argument of record_api is difficult. In other words: no. No luck yet, but still trying.
It'd probably be useful if you were to post a thread over there asking for help with the Home key on the Nexus Player as well. I'd imagine the higher the request for it the more eyes it'll receive.
Could be something that could be setup in llama or tasker? Set NP to listen for XYZ key command and then "Go Home". Just a thought.
Elrondolio said:
Not as yet. It seems more complicated than I first thought... the record_api function of flirc_util.exe can map HID commands to remote control buttons, but finding the correct HID for "Home" is difficult. There are thousands of HID commands as referenced in this document:
http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
We're looking at the ones in the Consumer Page starting on page 75. There is a special modifier in the second argument of Firc's record_api, 102, that supposedly tells the Flirc to reference that Consumer Page, but finding the "Home" key for the first argument of record_api is difficult. In other words: no. No luck yet, but still trying.
It'd probably be useful if you were to post a thread over there asking for help with the Home key on the Nexus Player as well. I'd imagine the higher the request for it the more eyes it'll receive.
Click to expand...
Click to collapse
Did you manage to map a true home function to your Flirc device, Elrondolio? The ALT + ESC key combination works okay for me in most cases although it doesn't work when I use Kodi. It's still better than no home functionality at all, though, so at least I won't always have to use the original Nexus Player remote when I need that feature. There's another thread at the Flirc forum which discusses this topic at http://forum.flirc.tv/index.php?/topic/1462-flirc-with-android-tv/.
ALT + TAB seems to be the ideal key combination to use for the home button. It works no matter which app you're in and although it causes the Nexus Player to display "your recent screens appear here" when you use that key combination, the on-screen message disappears as soon as you release the button.
Now if I can just figure out how to use the Nexus Player's Leanback keyboard with my universal remote so that I can select on-screen keys for searches instead of having the ENTER button close the keyboard off, that would make things just about perfect.
I was the one that posted in Flirc forum about the alt+tab for home.
For search using on-screen, map flirc to window key using command. then combine this key with navigation right key using your universal remote, such as logitech. so WIN + Right will launch search with on screen keyboard to type.
Thanks for posting your solution in the Flirc forum. I'm not trying to map a command to launch an on-screen keyboard but I'm trying to see if I can find a way to press the keys on the Leanback keyboard using my universal remote. This isn't a problem with some apps like Netflix or Kodi that have their own keyboards but for the Leanback keyboard that's used in apps like Google Play and YouTube, pressing the ENTER button on a universal remote causes the keyboard to close off. This problem does not exist with the original Nexus Player remote's select button because it is context-sensitive.
Elrondolio said:
If anyone has a standard keyboard hooked up to their NP either via Blutooth or USB OTG, can you tell me which keys correspond to the BACK and HOME functions on the Nexus Player or if those functions are working at all on your keyboard?
Click to expand...
Click to collapse
Back: Esc
Home: Alt+Esc
Unfortunately, the ALT + TAB key combination is not an ideal option for use with Android 6.0 Marshmallow. It actually brings up the recent apps screen and doesn't give the user easy access to the home screen (unless the recent apps screen is empty). I'll have to reprogram my Flirc back to ALT + ESC for the home screen function until someone finds a better solution for Android 6.0.
I don't have a nexus player but these issues sound similar to the shield tv.
To fix the Enter key issue with the onscreen keyboard, us the flirc_util to record the keypad's enter key (a different dev id than the other enter/return key):
HTML:
flirc_util.exe record_api 0 88
To record the Home button (that works from Kodi too), record Windows Key + Enter (the main Enter key works fine for this). Again, I don't have a nexus player but I assume it will work for it as well.
whiskaz77 said:
I don't have a nexus player but these issues sound similar to the shield tv.
To fix the Enter key issue with the onscreen keyboard, us the flirc_util to record the keypad's enter key (a different dev id than the other enter/return key):
HTML:
flirc_util.exe record_api 0 88
To record the Home button (that works from Kodi too), record Windows Key + Enter (the main Enter key works fine for this). Again, I don't have a nexus player but I assume it will work for it as well.
Click to expand...
Click to collapse
I tried out these key combinations with my Flirc on the Nexus Player and am happy to report that everything now works perfectly! Thank you kindly for sharing that useful information here with the rest of us.
GabbyWC said:
I tried out these key combinations with my Flirc on the Nexus Player and am happy to report that everything now works perfectly! Thank you kindly for sharing that useful information here with the rest of us.
Click to expand...
Click to collapse
Great! Happy to help. I'm glad it worked. Thanks for reporting back!
Windows Key + Enter => Home worked for me too!!! Kodi, Netflix and other apps now behave fine. Thanks a lot @whiskaz77

All in one remote (root required)

Recently I bought this remote from ebay after seeing some review in youtube.
Link to the picture
https://www.dropbox.com/s/2ayzhrxwp4pfmjx/remote_shipped.jpg?dl=0
https://www.dropbox.com/s/qb0gvydypsrp9wq/2015-05-01%2014.50.39.jpg?dl=0
bought this from this ebay seller. seller sees very nice and answered lot of my question before order. Shipping was fast too. Got item less than 10 days
http://www.ebay.com/itm/151463742596?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
Out of the box, the gyro mouse works great in fire tv with safa luncher. menu button and all drictional button, keyboard works great. but Home button and back button does not work.
for some reason home and back button does not show any number in fire tv key scan app.
Anyway, I liked the gyro mouse so much I made a fix for it and like to share with you. Good thing of this remote is you can disable mouse operation any time by pressing a key or flipping the keyboard side up.
I remap the home button to vol- button and back button to vol+ button. Now everything works fine. But still have Play/Pause, FF, RW button missing but I can live with that.
Play pause can be done on the keyboard side by spacebar.
This remote also works in recovery mode too.
https://www.dropbox.com/s/otb7dp1y0yl9etb/Vendor_24a7_Product_2402.kl?dl=0
to remap it please copy the attached .kl file to the /system/usr/keylayout folder.
Do not rename this file.
for copy procedure follow this link
http://www.aftvnews.com/fix-ps4-dualshock-4-button-mapping-on-the-fire-tv/
I basically used the Generic.kl file and did some modification for these two button.
let me know if you have any issue.
Where is the file? and what do I search for on eBay to see this?
http://www.amazon.com/Multi-function-Keyboard-Wireless-Receiver-Installation/dp/B00D8119EO
goggles99 said:
Where is the file? and what do I search for on eBay to see this?
Click to expand...
Click to collapse
file link added.

Remap Hardware Buttons

I was wondering if it is possible to remap the hardware buttons on an android headunit. For example at the minute my media buttons only work for the stock apps, so skip next/previous etc. are useless in poweramp. It would also be cool to remap a useless source button to something like voice control. I have tried downloading apps that have always worked for me flawlessly in the past such as multilnguage keymap redefiner but they don't detect anything on key press. I know that you can manually remap by editing a .kl file but my headunit isn't rooted.
Thanks!
maybe under settings/general/extra settings/panel keys ?
extra settings password could be 123456
Hi! I hadn't read your thread so I posted this... Did you ever get around it?
http://forum.xda-developers.com/and...emap-car-buttons-to-interact-android-t3388375

[Guide] Skip slide unlock (NSwitch/PSP style instant resume)

Install this: https://play.google.com/store/apps/details?id=org.jraf.android.nolock&hl=en_US
Non play store link (It's a free app): https://apkpure.com/no-lock/org.jraf.android.nolock
Just install hit the big unlock button when you start the app, thats it!
Does take a moment to start on each activation / boot, won't notice it unless you try to immediately sleep then resume.
Was surprisingly hard to figure out this seemingly simple tweak, so figured I'd post it here. Just got a Nintendo switch and thought the instant resume was pretty nifty, wondered why the Xplay didn't do that so thought I'd look into it.
Tried a few other methods, first by enabling then disabling the custom lock screen in smart launcher, which worked but only for that boot.
Then tried an app called antilocker, which has an launch on boot function, which doesn't seem to work. So again it only works for that boot and you gotta redo it each time.
No Lock luckily just works!
If you want to customize which keys wake the phone just edit the files in /system/usr/keylayout/
Pretty simple to figure out, just add or remove WAKE_DROPPED from the key entry you want.
For example I copy the Switch and have it set to just be the power button that wakes.
Also considering making all the gamepad keys wake.
Another thing you can do with keybinds is make the volume buttons l2/r2 buttons, just copy the r1/r2 entries but change the number, removing the volume_up and down entries at the same time.
This will disable the volume function ofc, but let you use them as shoulder buttons in other apps, including the built in PSXPeria emulator!
To get volume buttons back you can use this app to make the shoulder buttons work as them. https://forum.xda-developers.com/showthread.php?t=1262314
I haven't tested it but I bet you could switch the volume buttons to be the l1/r1 buttons and I bet it'd think they were the shoulder buttons.
Edit: Tested, unfortunately doesn't work.
the volume to l1 r1 function would be very interesting for psx games...i don´t have a switch so i don´t exactly know what the instant resume function

Categories

Resources