How to assign the search function to a keyboard shortcut - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Skins Support (https://forum.kodi.tv/forumdisplay.php?fid=67) +---- Forum: Amber (https://forum.kodi.tv/forumdisplay.php?fid=203) +---- Thread: How to assign the search function to a keyboard shortcut (/showthread.php?tid=353649) |
How to assign the search function to a keyboard shortcut - Industry - 2020-04-18 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). RE: How to assign the search function to a keyboard shortcut - bsoriano - 2020-04-19 (2020-04-18, 23:01)Industry Wrote: Does anyone know how to assign the search function to a keyboard shortcut?@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 RE: How to assign the search function to a keyboard shortcut - Industry - 2020-04-19 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. RE: How to assign the search function to a keyboard shortcut - bsoriano - 2020-04-19 (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? @Industry, that is precisely my recommendation. Regards, Bart RE: How to assign the search function to a keyboard shortcut - Industry - 2020-04-19 I tried editing the sub-menu which changes the bottom panel 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 RE: How to assign the search function to a keyboard shortcut - bsoriano - 2020-04-19 (2020-04-19, 04:17)Industry Wrote: I tried editing the sub-menu which changes the bottom panel@Industry, Amber provides a way to customize the popup menu that appears when pressing S: When you select that option, you get something like this: 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": Now, let's change the action to start_search: Select Custom Item (it's at the bottom): And replace activatewindow(settings) by start_search: Then change the label from Settings to Search: 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. RE: How to assign the search function to a keyboard shortcut - Industry - 2020-04-22 That seemed to have worked. A little clunkier than I would've liked, but at least it gets the job done. Thanks @bsoriano |