Kodi Community Forum

Full Version: Accessing keyboard.xml on Nvidia Shield
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi All,

I've recently purchased a Shield Pro TV 2019 and I'm running the official kodi from google play. Just to confirm I haven't added any banned addons. I've been playing around with a logitech remote, FLIRC and the keymap editor to create some custom buttons to use during playback. I now wish to create a command to toggle through the audio streams, however I understand from another forum post this is not possible with the keymap editor addon. I understand that I need to go into keyboard.xml and add some code:

https://forum.kodi.tv/showthread.php?tid=87649

My question is - having never used kodi outside of the Nvidia Shield and android boxes GUI - how do I even go about accessing this file to amend it? Do I need to plug the shield into my pc? Do I need to access it's IP address? Or do I somehow create this file on my PC and then transfer it to the shield somehow? If that is the case do I need to transfer the original keyboard.xml from the system area to my PC, amend it then transfer it back to the userdata area somehow? 

Sorry for the newbie question, if someone could point me in the right direction it would be much appreciated. I also plan on making some changes to the advancedsettings.xml and guess the process to do that will be the same. 

Many thanks
(2021-03-01, 10:39)JamesBronson15 Wrote: [ -> ]My question is - having never used kodi outside of the Nvidia Shield and android boxes GUI - how do I even go about accessing this file to amend it? Do I need to plug the shield into my pc? Do I need to access it's IP address? Or do I somehow create this file on my PC and then transfer it to the shield somehow?

The Nvidia Shield has an onboard SMB file server you can enable. That way you can access the necessary files via your network remotely. Alternatively you can fiddle with a USB stick and a text editor you need to install on the Shield... The former is the better/easier choice.
(2021-03-01, 10:52)Klojum Wrote: [ -> ]
(2021-03-01, 10:39)JamesBronson15 Wrote: [ -> ]My question is - having never used kodi outside of the Nvidia Shield and android boxes GUI - how do I even go about accessing this file to amend it? Do I need to plug the shield into my pc? Do I need to access it's IP address? Or do I somehow create this file on my PC and then transfer it to the shield somehow?

The Nvidia Shield has an onboard SMB file server you can enable. That way you can access the necessary files via your network remotely. Alternatively you can fiddle with a USB stick and a text editor you need to install on the Shield... The former is the better/easier choice.

Thanks Klojum, I've gone into the shield and enabled transferring over network, that gives me my username, password and ip address. I've then gone to my pc (which is on the same network as the shield) but the IP address brings up nothing. I've gone into windows 10 and enabled SMB, restarted but still nothing. Tried mapping it but nothing. If I go into network in windows 10 I can see the shield listed under other devices, but clicking on it just brings up the properties I can't actually access it. Any ideas? Thanks
Hmm.. That's exactly one of those things why I stepped away from Windows some 10 years ago, and went the Linux way. The whole SMB version changes thing these days is giving me a headache. The Shield should be more than capable, it supports up to SMBv3, I believe.

Any chance that your firewall is blocking things, or some overachieving antivirus tool is being a d*** road block?
(2021-03-01, 12:02)Klojum Wrote: [ -> ]Hmm.. That's exactly one of those things why I stepped away from Windows some 10 years ago, and went the Linux way. The whole SMB version changes thing these days is giving me a headache. The Shield should be more than capable, it supports up to SMBv3, I believe.

Any chance that your firewall is blocking things, or some overachieving antivirus tool is being a d*** road block?

From what I read I think the shield only does SMB1 - which is now turned off in Windows 10 and turning it back on made no difference. I'll try again with disabling with the virus/firewall. Failing that I've just read you can connect the new shield directly to a PC with a USB A cable, but can't see if that's just to transfer say video and audio files to it, or whether that lets you get into the kodi system files.
It's not the official announcement, but it's a start: https://www.reddit.com/r/AndroidTV/comme...t_here_is/

You are trying to connect to the Shield via your File Manager and not a Web browser, are you? (Just asking..)
The simplest way is to use the Kodi File Manager to transfer the file off & onto the Shield. If you have an exisitng network share (where either pc or nas is the smb/nfs server) then this can be used to get files off the Shield, or alternatively if no network share avaialble use a USB stick. See https://kodi.wiki/view/File_manager for info on using Kodi File Manager, when adding a source to access different Kodi files then the easiest way is to use the special protocol path, see https://kodi.wiki/view/Special_protocol in this case you'd need to add the path special://xbmc to point to the Kodi installation path, then in there goto system folder then keymaps folder.
(2021-03-01, 13:23)Klojum Wrote: [ -> ]It's not the official announcement, but it's a start: https://www.reddit.com/r/AndroidTV/comme...t_here_is/

You are trying to connect to the Shield via your File Manager and not a Web browser, are you? (Just asking..)

I was trying by web browser and windows explorer, also tried mapping the drive, but unfortunately none of them worked.
(2021-03-01, 13:31)jjd-uk Wrote: [ -> ]The simplest way is to use the Kodi File Manager to transfer the file off & onto the Shield. If you have an exisitng network share (where either pc or nas is the smb/nfs server) then this can be used to get files off the Shield, or alternatively if no network share avaialble use a USB stick. See https://kodi.wiki/view/File_manager for info on using Kodi File Manager, when adding a source to access different Kodi files then the easiest way is to use the special protocol path, see https://kodi.wiki/view/Special_protocol in this case you'd need to add the path special://xbmc to point to the Kodi installation path, then in there goto system folder then keymaps folder.

Ok getting somewhere. Set all of this up, I have now copied to keyboard.xml to my PC, I'm able to edit it and move it back. So that is a big step forward. However now I am struggling with what I actually want to do. Following this post:

https://forum.kodi.tv/showthread.php?tid=87649

I am trying to shortcut to the H key so it toggles the audio stream, then I'll map a button on my remote to the H key. I've tested it and it still does what H does for the official kodi config, so clearly I've done something wrong. 

First thing I did was add:

<keymap>
<global>
<keyboard>
<h>AudioNextLanguage</h>
</keyboard>
</global>
</keymap>

To the very bottom of the existing keyboard.xml, leaving everything else there. The second time I deleted everything from the existing keyboard.xml and only included the text above. Each time I transferred the amended keyboard.xml to special://profile. 

Am I doing something wrong? 

Thanks
(2021-03-01, 14:20)JamesBronson15 Wrote: [ -> ]First thing I did was add:

I would not use global, it's a bit illogical to ask for the next language in the Kodi GUI menu...
xml:

<keymap>
<FullscreenVideo>
<keyboard>
<h>AudioNextLanguage</h>
</keyboard>
</FullscreenVideo>
</keymap>
(2021-03-01, 14:52)Klojum Wrote: [ -> ]
(2021-03-01, 14:20)JamesBronson15 Wrote: [ -> ]First thing I did was add:

I would not use global, it's a bit illogical to ask for the next language in the Kodi GUI menu...
xml:

<keymap>
<FullscreenVideo>
<keyboard>
<h>AudioNextLanguage</h>
</keyboard>
</FullscreenVideo>
</keymap>

Thanks, I've amended it like you suggest and transferred it back to my user folder. But still, when I press H, I get an error "No PVR add-on enabled". According to this:

https://kodi.wiki/view/Keyboard_controls

The default value for H is "Live TV channels window". So it appears that H is ignoring the custom keyboard.xml and still doing what the default key does.
(2021-03-01, 14:20)JamesBronson15 Wrote: [ -> ]I am trying to shortcut to the H key so it toggles the audio stream, then I'll map a button on my remote to the H key. I've tested it and it still does what H does for the official kodi config, so clearly I've done something wrong. 

AudioNextLanguage is already in the keymap https://github.com/xbmc/xbmc/blob/master...d.xml#L381

So long press UP key does this by default.

If you want to change this to H then edit the exisitng entry.

(2021-03-01, 14:20)JamesBronson15 Wrote: [ -> ]To the very bottom of the existing keyboard.xml, leaving everything else there. The second time I deleted everything from the existing keyboard.xml and only included the text above. Each time I transferred the amended keyboard.xml to special://profile. 

Did you put it in the root of special://profile or did you put it in special://profile/keymaps ? as it needs to be in the keymaps folder.
(2021-03-01, 15:01)JamesBronson15 Wrote: [ -> ]
(2021-03-01, 14:52)Klojum Wrote: [ -> ]
(2021-03-01, 14:20)JamesBronson15 Wrote: [ -> ]First thing I did was add:

I would not use global, it's a bit illogical to ask for the next language in the Kodi GUI menu...
xml:

<keymap>
<FullscreenVideo>
<keyboard>
<h>AudioNextLanguage</h>
</keyboard>
</FullscreenVideo>
</keymap>

Thanks, I've amended it like you suggest and transferred it back to my user folder. But still, when I press H, I get an error "No PVR add-on enabled". According to this:

https://kodi.wiki/view/Keyboard_controls

The default value for H is "Live TV channels window". So it appears that H is ignoring the custom keyboard.xml and still doing what the default key does.

What an idiot I am! I was putting the keyboard.xml straight into my user data, not userdata/keymap! Thank you Klojum and jjd-uk for you help - everything is now working Smile
Good Smile I was about to say the log file will tell if it was being loaded, and you can access log file to transfer off with special://logpath so although not needed now for this perhaps useful for you to know in the future if you have any other issues where you want to look at the log.
(2021-03-01, 15:16)jjd-uk Wrote: [ -> ]Good Smile I was about to say the log file will tell if it was being loaded, and you can access log file to transfer off with special://logpath so although not needed now for this perhaps useful for you to know in the future if you have any other issues where you want to look at the log.

Thanks again, got there in a slightly different way then but at least it's working Smile

Sorry one last question. Another command I'd like to map is subtitle delay, not plus or minus, but the actual bar that comes up on the screen that allows you to plus or minus via the directional keys. Audio delay is in the keymap but from the looks of it subtitle delay is not. I've found a few posts where people want to have one key for plus and one key for minus, but not what I want i.e. the actual bar, that stays on the screen until I press ok. Does that make sense and if so what would you say is the best way to assign that command to a key?
Pages: 1 2