Solved Keymap loader with descriptions
#1
Getting the right keymap for a given remote can really change the Kodi experience for a user. Due to many keymaps being seen as generic "keyboards", and because Android can't tell the difference between USB vender IDs, it's nearly impossible to have a "catch-all" default. For years we've been trying to collect recommended maps for various remotes, and then have put those maps on the wiki. There's also an excellent keymapper add-on as well. However, I hope to make it even easier for users to get the right map.

Originally I thought of just having users enter an HTTP source in the file manager, and use that to load keymaps. However, that's still a lot of steps to ask someone to do, entering URLs, understanding how the file manager works, etc. The biggest issue is that it would lack any kind of description of what the keymap did.

What I would like is a simple add-on that can present a list of available maps with descriptions. Maybe even a picture or two. When selected, it gets copied over to the keymaps directory. Maybe also have a way to show the current keymaps in the keymaps directory and give an option to delete them. To make it easier on the add-on author, it would be nice if the available maps and their description could be updated independently of the add-on. Maybe read from a directory that also contains a text file for the descriptions.

It's not perfect, but the idea is to just hold us over until the new input stuff from garbear comes along (which is really awesome, I highly recommend checking it out).

Thoughts?
Reply
#2
Links would help.
Reply
#3
You mean of example keymaps? I haven't uploaded anything anywhere in xml format, yet. There's just some copy/paste instructions on the wiki: Category:Custom keymaps (wiki).
Reply
#4
@ned Scott, I am currently working on this request. The current implementation uses GitHub to access keymaps (keymap_filename.xml) with descriptions (keymap_filename.txt) from a repository. It will cache the information in the userdata folder for the add-on and download the keymaps. If changes are made on the repository to a keymap or description for a keymap the add-on will download the new changes before displaying the list.

TODO: backup/restore original keymap, copy selected keymap to keymap directory, and possibly look into displaying image for the keymap.
Reply
#5
(2016-01-08, 02:04)curti Wrote: @ned Scott, I am currently working on this request. The current implementation uses GitHub to access keymaps (keymap_filename.xml) with descriptions (keymap_filename.txt) from a repository. It will cache the information in the userdata folder for the add-on and download the keymaps. If changes are made on the repository to a keymap or description for a keymap the add-on will download the new changes before displaying the list.

TODO: backup/restore original keymap, copy selected keymap to keymap directory, and possibly look into displaying image for the keymap.

You are my hero :D
Reply
#6
@ned Scott, I have uploaded an alpha version to a test repo and added you as a collaborator. The repo includes a few keymaps copied from your post and http://kodi.wiki/view/Alternative_keymap..._TV_remote .

The plugin currently lists the available *_keymap.xml files in the test repo. If a list item is selected it will display the description using xbmcgui.Dialog().ok() which I know is not ideal for long descriptions. The *_keymap.xml files can be downloaded/loaded/unloaded/deleted via the context menu. The plugin should update the list if items are added/updated in the repo.

NOTE: GitHub limits unauthenticated API requests to 60 requests/hour. This limit includes the initial download of available keymaps. 60-len(keymap_txt_list). Additional requests are made per keymap download and/or per update made on the repo.
Reply
#7
Thanks to, @ronie, I have updated the plugin to display the description using the text viewer dialog. The update can be found here.
Reply
#8
(2016-01-04, 00:17)Ned Scott Wrote: It's not perfect, but the idea is to just hold us over until the new input stuff from garbear comes along (which is really awesome, I highly recommend checking it out).

Soon™. https://github.com/xbmc/xbmc/pull/8807
Reply
#9
Very nice! Would it be possible to trigger the download using an okay button, rather than the context menu? Even if that means using a dialog box that is much smaller, that would be fine. The description doesn't need to have a full explanation of the map (a short URL could be used for a full map, if needed).
Reply
#10
(2016-01-09, 06:56)Ned Scott Wrote: Very nice! Would it be possible to trigger the download using an okay button, rather than the context menu? Even if that means using a dialog box that is much smaller, that would be fine. The description doesn't need to have a full explanation of the map (a short URL could be used for a full map, if needed).

I have made some changes per your request. Instead of using the context menu to download/load/unload keymaps it is now handled by selecting a keymap from the list. If the keymap does not exist locally it will prompt a download using a yes/no dialog and display 100 characters from the description. If the keymap has been downloaded but it is not in the keymap directory selecting it will copy it to the keymap directory; and if it is in the add-on/keymap directory selecting it will remove it from the keymap directory. The full description of the keymap can be displayed using the context menu; and the keymap can be removed from the add-on directory using the context menu.

The download can be found here.
Reply
#11
I love it!

I'll test it on the various devices I have, but so far it works really well.
Reply



Logout Mark Read Team Forum Stats Members Help
Keymap loader with descriptions0
This forum uses Lukasz Tkacz MyBB addons.