2013-01-21, 10:00
How can I create a shortcut for bookmarks (or go to top / bottom etc. of the files lists)? Or is there an add on the let's you easily create / edit bookmarks?
<keymap>
<FullscreenVideo>
<keyboard>
<some-key>ActivateWindow(VideoBookmarks)</some-key>
</keyboard>
</FullscreenVideo>
<VideoOSD>
<keyboard>
<some-key>ActivateWindow(VideoBookmarks)</some-key>
</keyboard>
</VideoOSD>
</keymap>
<keymap>
<keyboard>
<FullscreenVideo>
<b>ActivateWindow(VideoBookmarks)</b>
</FullscreenVideo>
<VideoOSD>
<b>ActivateWindow(VideoBookmarks)</b>
</VideoOSD>
</keyboard>
</keymap>
Quote:Keyboard shortcut to more quickly navigate a list of files: Press the END key to go to the bottom of a list of items; press HOME key to return to the top of the list. Press PGDN (Page Down) to scroll down to the next page of items in the list; press PGUP (PageUp) to go up one pageThese keys do not work for me, the others.
Quote: Press SHIFT+(A-Z) to go to the first item in the list that begins with the select letter of the alphabet (e.g., Shift+C goes to the first item that begins with "C").They work.
import xbmc, xbmcgui
xbmc.executebuiltin('xbmc.ActivateWindow(videobookmarks)')
xbmc.executebuiltin('SendClick(10125,2)')
xbmc.executebuiltin('xbmc.action(previousmenu)')
Quote:Save the script as "setbookmark.py"I did, saved here: C:\Users\Dirk\AppData\Roaming\XBMC\userdata\keyboard.xml
<b>RunScript(/PATH/TO/SCRIPT/setbookmark.py)</b>
<keymap>
<keyboard>
<FullscreenVideo>
<b>ActivateWindow(VideoBookmarks)</b>
</FullscreenVideo>
<VideoOSD>
<b>ActivateWindow(VideoBookmarks)</b>
</VideoOSD>
</keyboard>
</keymap>
Quote:Be sure your file is really named keyboard.xml rather than keyboard.xml.txt (choose the option to show file extension in your OS file manager).Yes, all like it should be.
Quote:You can also enable debug logging in XBMC, press the "b" button several times while watching a video, exit XBMC and then examine your debug log (xbmc.log) to see what action, if any, XBMC performed in response to your key presses. This will help diagnose why the key mapping doesn't work.OK, may be we can find out then also, why deleting in the file lists does not work properly (when you after watching a video want to delete the video you first has to open another video, then go back to the video before and delete it).
(2013-01-22, 20:06)Dirki Wrote: My keyboard.xml now looks:
Code:<b>RunScript(/PATH/TO/SCRIPT/setbookmark.py)</b>
<keymap>
<keyboard>
<FullscreenVideo>
<b>ActivateWindow(VideoBookmarks)</b>
</FullscreenVideo>
<VideoOSD>
<b>ActivateWindow(VideoBookmarks)</b>
</VideoOSD>
</keyboard>
</keymap>
It doesn't work
<keymap>
<FullscreenVideo>
<keyboard>
<b>RunScript(/PATH/TO/SCRIPT/setbookmark.py)</b>
</keyboard>
</FullscreenVideo>
<VideoOSD>
<keyboard>
<b>RunScript(/PATH/TO/SCRIPT/setbookmark.py)</b>
</keyboard>
</VideoOSD>
</keymap>
Quote:Also, I'm assuming you are using the *actual* path to your script and not the literal term "/PATH/TO/SCRIPT/"?Ah, sorry, stupid...
Quote:I recommend trying it with my original keyboard.xml and looking in your debug log for the problem first. Once you get this working, then add in the script by zepo.Yes, OK.
Quote:For starters the keyboard.xml should be inside a folder called keymaps not directly in the userdata folder.But there already is the default XBMC keyboard.xml, or am I wrong?
Quote:If you put the script inside your userdata folder. The path will be:Thank you, I have changed that.
C:\Users\Dirk\AppData\Roaming\XBMC\userdata\setbookmark.py
Quote:Then replace <b>ActivateWindow(VideoBookmarks)</b> with <b>RunScript(C:\Users\Dirk\AppData\Roaming\XBMC\userdata\setbookmark.py)</b>Thanks to artrafael it is done.
Quote:It must be under fullscreenvideo in the keyboard.xml. You should read a bit about keymapping, it will make it easier for you.OK, I understand.
<keymap>
<keyboard>
<FullscreenVideo>
<b>ActivateWindow(VideoBookmarks)</b>
</FullscreenVideo>
<VideoOSD>
<b>ActivateWindow(VideoBookmarks)</b>
</VideoOSD>
</keyboard>
</keymap>
<keymap>
<keyboard>
<FullscreenVideo>
<b>RunScript(C:\Users\Dirk\AppData\Roaming\XBMC\userdata\setbookmark.py)</b>
</FullscreenVideo>
<VideoOSD>
<b>RunScript(C:\Users\Dirk\AppData\Roaming\XBMC\userdata\setbookmark.py)</b>
</VideoOSD>
</keyboard>
</keymap>
import xbmc, xbmcgui
xbmc.executebuiltin('xbmc.ActivateWindow(videobookmarks)')
xbmc.executebuiltin('SendClick(10125,2)')
xbmc.executebuiltin('xbmc.action(previousmenu)')