Quick notes on keymaps

Not copied to user profile and functionality update
I was just fiddling around with my Keymap.xml file only to find that that is no longer what is looked at to determine keymapping information.

I then copied /Applications/Plex.app/Contents/Resources/Plex/keymaps to ~/Library/Application Support/Plex and I was back in business.

**Note 1:** My feeling is that these files should be automatically copied to ~/Library/Application Support/Plex without the user being required to do it, as is convention with other similar config files

The reason I did all this was because I wanted to map [ and ] to SmallStepBack and SmallStepForward respectively.

**Note 2:** SmallStepForward isn't a function that exists (SmallStepBack is).

I checked some XBMC doco and it doesn't look like it is in there either... which struck me as really strange omission - surely coding it in is trivial given that SmallStepBack is already there?

Now.. I'm not a C programmer, but, looking in GUIWindowFullScreen.cpp I think all that needs to be added after:


case ACTION_SMALL_STEP_BACK:<br />
	{<br />
	  int orgpos = (int)g_application.GetTime();<br />
	  int triesleft = g_advancedSettings.m_videoSmallStepBackTries;<br />
	  int jumpsize = g_advancedSettings.m_videoSmallStepBackSeconds; // secs<br />
	  int setpos = (orgpos > jumpsize) ? orgpos - jumpsize : 0; // First jump = 2*jumpsize<br />
	  int newpos;<br />
	  do<br />
	  {<br />
		setpos = (setpos > jumpsize) ? setpos - jumpsize : 0;<br />
		g_application.SeekTime((double)setpos);<br />
		Sleep(g_advancedSettings.m_videoSmallStepBackDelay); // delay to let mplayer finish its seek (in ms)<br />
		newpos = (int)g_application.GetTime();<br />
	  }<br />
	  while ( (newpos > orgpos - jumpsize) && (setpos > 0) && (--triesleft > 0));<br />
 <br />
	  //Make sure gui items are visible<br />
	  g_infoManager.SetDisplayAfterSeek();<br />
	}<br />
	return true;<br />
	break;



is


case ACTION_SMALL_STEP_FORWARD:<br />
	{<br />
	  int orgpos = (int)g_application.GetTime();<br />
	  int triesleft = g_advancedSettings.m_videoSmallStepFowardTries;<br />
	  int jumpsize = g_advancedSettings.m_videoSmallStepForwardSeconds; // secs<br />
	  int setpos = (orgpos > jumpsize) ? orgpos - jumpsize : 0; // First jump = 2*jumpsize<br />
	  int newpos;<br />
	  do<br />
	  {<br />
		setpos = (setpos > jumpsize) ? setpos + jumpsize : 0;<br />
		g_application.SeekTime((double)setpos);<br />
		Sleep(g_advancedSettings.m_videoSmallStepForwardDelay); // delay to let mplayer finish its seek (in ms)<br />
		newpos = (int)g_application.GetTime();<br />
	  }<br />
	  while ( (newpos > orgpos - jumpsize) && (setpos > 0) && (--triesleft > 0));<br />
 <br />
	  //Make sure gui items are visible<br />
	  g_infoManager.SetDisplayAfterSeek();<br />
	}<br />
	return true;<br />
	break;



int setpos needs to be modified to make sure we don't jump past the end of the file

As well as counterparts for these 3 in settings.h


	int m_videoSmallStepBackSeconds;<br />
	int m_videoSmallStepBackTries;<br />
	int m_videoSmallStepBackDelay;



And some odds and sods in advancedsettings.xml

Or does anyone have some other way to do this without changing the code?

How about I do you one better? The reason these files AREN’T copied the App Support folder is we then can’t make future updates to keymap files for users with out having to overwrite settings they have made… So what we did is made it so the master keymap files are inside the application bundle, you can create secondary keymaps outside this bundle that ONLY have the changes you want.



Say we added this to ~/Library/Application Support/Plex/keymaps/Harmony.xml



<keymap><br />
  <global><br />
	<harmonyremote><br />
	  <play>Stop</play><br />
	</harmonyremote><br />
  </global><br />
</keymap>



Now the Play button would be changed to stop, but ONLY the play button. All other Harmony settings would be pulled from the master files inside the bundle that we can update from version to version.

Also, SmallStepBack is from the old Xbox days (mapped to the Back button on the Xbox controller) - there are actually 5 step functions: SmallStepBack, StepBack, StepForward, BigStepBack and BigStepForward. SmallStepBack isn’t really used any more.

Now that makes sense :slight_smile:



Now I’m wondering what tool could be used to generate a picture of the final keymap (which Plex obv uses internally) which is the original one with the user prefs one laid over top of it.



Speak for yourself ;)

I've got the attention span of a gnat, zone out for 10 secs, miss some dialogue and use it constantly. It is also brilliant for audio books where you miss the meaning of something, or don't catch something someone said correctly.

Ah... the ups and downs of a thrill a minute life :D

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.