Sunday, May 31, 2015

Changing the mouse wheel behavior for Kodi/XBMC

Kodi (A.K.A. XBMC) is a wonderful media center software that can do pretty much everything about the home entertainment and more.   I am using a wireless mouse to control a laptop connected to TV.  One annoying thing is that the mouse wheel is linked to forward/backward in the video playback.  This leads to some sudden jumps in playback when I accidentally hit the mouse (wheel).   Meanwhile, there is no mouse action that can controls the volume up/down easily.  I have to either uses the keybaord (i.e. stand up and step forward) or use the TV/receiver control (i.e. fumble around).  It finally get to the point that I have to find a solution.  After some search and experiments, particularly thanks to the excellent explanation on the wiki (http://kodi.wiki/view/keymap) I was able to change the mouse wheel to control volume.  Here is what I did:

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
   <fullscreenvideo>
 <mouse>
  <wheelup>VolumeUp</wheelup>
  <wheeldown>VolumeDown</wheeldown>
 </mouse>
  </fullscreenvideo>
  
  <!--Change the video control -->
   <videoosd>
 <mouse>
  <wheelup>VolumeUp</wheelup>
  <wheeldown>VolumeDown</wheeldown>
 </mouse>
  </videoosd>
</keymap>

There are several posts talking about the <fullscreenvideo> window (http://kodi.wiki/view/keymap#Windows), which controls the behavior when there is no menu.  But often any movement of the mouse first activates the <videoosd> window, and we have to change the wheelup/down in that window as well. Otherwise, you still get forward/backward bahavior.  Hopefully this can help you as well.

No comments :