Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
How to assign the search function to a keyboard shortcut
#1
Does anyone know how to assign the search function to a keyboard shortcut?
I am trying to set the Amber search function to S by editing the keyboard.xml file in keymaps folder. According to the skin's settings, it seems the function being called is Start_Search, but that doesn't seem to work for me. I have also tried ActivateWindow(Start_Search) and ActivateWindow(Search) without any luck. Assigning other functions like ActivateWindow(Videos,Root) work just fine.
The reason that I ask is that when I tried the Kodi inbuilt search function, VideoLibrary.Search, doesn't seem to yield any results (which is a matter for another thread).

Image
#2
(2020-04-18, 23:01)Industry Wrote: Does anyone know how to assign the search function to a keyboard shortcut?
I am trying to set the Amber search function to S by editing the keyboard.xml file in keymaps folder. According to the skin's settings, it seems the function being called is Start_Search, but that doesn't seem to work for me. I have also tried ActivateWindow(Start_Search) and ActivateWindow(Search) without any luck. Assigning other functions like ActivateWindow(Videos,Root) work just fine.
The reason that I ask is that when I tried the Kodi inbuilt search function, VideoLibrary.Search, doesn't seem to yield any results (which is a matter for another thread).

Image
@Industry, start_search is an Amber "shortcut" for multiple actions which happen when you click the search menu item.  The skin does not have a window that prompts you for a search string and then does the search, but first resets the search string (which opens the keyboard dialog so that you can enter a search string), and then opens a custom window that show you the result.  Thus, assigning "start_search" to a key will not provide you anything, as it is not a Kodi command.

"S" usually opens the shutdown menu in Kodi.  You have modified your keyboard mappings so that it does not? I ask because you can also add the "start_search" as the menu action for a menu item in the power menu (Settings, Amber Settings, Home Layout, Customize Power Menu).  The power menu is as customizable as the main menu, it also uses script,skinshortcuts for its customization.

Regards,

Bart
#3
That is very helpful, thank you. So it sounds like there is no way to trigger that Amber command?

Yes, sorry, I should have mentioned I was thinking of remapping the S key to search instead of invoke the power menu.

To clarify, are you recommending adding a new sub-menu item to the power menu that invokes the search function? That could be a reasonable workaround if there is no way to activate it directly.
#4
(2020-04-19, 02:35)Industry Wrote: That is very helpful, thank you. So it sounds like there is no way to trigger that Amber command?

Yes, sorry, I should have mentioned I was thinking of remapping the S key to search instead of invoke the power menu.

To clarify, are you recommending adding a new sub-menu item to the power menu that invokes the search function? That could be a reasonable workaround if there is no way to activate it directly.

@Industry, that is precisely my recommendation.

Regards,

Bart
#5
I tried editing the sub-menu which changes the bottom panel 
Image
But unfortunately, the search does not work and this does not change the popup menu that appears when pressing S to bring up the power menu  Confused
#6
(2020-04-19, 04:17)Industry Wrote: I tried editing the sub-menu which changes the bottom panel 
Image
But unfortunately, the search does not work and this does not change the popup menu that appears when pressing S to bring up the power menu  Confused
@Industry, Amber provides a way to customize the popup menu that appears when pressing S:

Image
 When you select that option, you get something like this:

Image

In that screenshot I have already added the search option.  I realize that I did not make it very intuitive to add the search option, and that is something I have to improve.  In the meantime, in this dialog, add a new menu item, and choose anything as the new menu item (sorry, Search is not an option to add yet, so we'll add anything and then change the action).  So, for eaxmple, choose "Common", and then "Settings":

Image

Image
Now, let's change the action to start_search:

Image

Select Custom Item (it's at the bottom):

Image

And replace activatewindow(settings) by start_search:

Image

Then change the label from Settings to Search:

Image

Image

Go back to the main menu.  Now when I press S, the option Search will be there, and it will work as expected.  Don't worry about setting the thumbnail, I need to fix that, as it only applies to submenu items.

I hope to make this easier in a future update.

Regards,

Bart

EDIT: @Industry, if you do not mind updating directly from GitHub, the Leia branch in GitHub (https://github.com/bartolomesoriano/skin.amber) has code changes to make it easier to choose Search as a menu item.  Now when you go to choose item for menu, you will find Search under Common.  That already has the correct label and action.
#7
That seemed to have worked. A little clunkier than I would've liked, but at least it gets the job done. Thanks @bsoriano

Logout Mark Read Team Forum Stats Members Help
How to assign the search function to a keyboard shortcut0