Wednesday, January 11, 2012

Part 2 - Adding missing keyboard shortcuts

The ultimate aim of this project was to end up with a situation where for every button on the on-screen remote control there was an equivalent button on the physical Harmony remote control. This would even be an advantage over the Slingcatcher remote control where certain 'special' buttons could only be accessed through an on-screen menu.

However, in order to achieve this, we are relying on a keyboard shortcut existing for every button on the on-screen remote. This is because later on we are going to use the Remote Buddy software to map button presses on the Harmony remote to these keyboard shortcuts to control the remote satellite/cable box.

So the first thing you need to do is check to see which keyboard shortcuts are present and which, if any, are missing. The easiest way to do this is simply to watch your Slingbox at watch.slingbox.com, click on the 'Remote' button and then hover the mouse pointer over each button in turn. If there is a keyboard shortcut mapped then it will tell you in brackets after the button name, otherwise there will be nothing in brackets.

Since we are going to need to know later on which button is assigned to which keyboard shortcut, I suggest writing them all down at this point.

My TV provider in the UK is Sky+ HD and here is what I wrote down for my on-screen remote:

Power on/off (Ctrl+Shift+P)
The Sky+ HD Remote
Sky (Ctrl+Shift+S)
Box Office
Services
Guide (G)
Interactive
Mute (Cmd+Shift+M)
Info (I)
Volume Up (Cmd+up)
Volumne Down (Cmd+down)
Channel Up (=)
Channel Down (-)
Text
Back Up
Help
Rewind (R)
Fast Forward (F)
Pause (U)
Play (P)
Record (Ctrl+Shift+R)
Stop (S)
Red (Ctrl+Shift+D)
Green (Ctrl+Shift+G)
Yellow (Ctrl+Shift+Y)
Blue (Ctrl+Shift+B)
Numbers (0-9)

As you can see, the Box Office, Services, Interactive, Text, Back Up and Help buttons didn't have a keyboard shortcut assigned. The lack of a Back Up button is a particular problem as it means there is no easy way of exiting from the EPG!

With the Slingbox there are two separate parts to the remote control side of things. There are the binary file(s) that are loaded onto the Slingbox and which tells the Slingbox which IR codes to send to your satellite/cable box via the IR transmitters, and then there are the files that define the visual appearance of the remote control inside the web player plugin and desktop player software.

In this case, it is only the latter we are interested in here since it turns out that the keyboard shortcuts are associated with the button graphics in the skin and have nothing to do with the files loaded onto the Slingbox during the setup process.

So, where to start with adding the missing shortcuts? Fortunately, those ever-helpful folk at the Placeshifting Enthusiasts website have written a detailed tutorial that covers the process of editing these skin files.

You can find it here:

How To Edit Your Remote Skin

The article is slightly dated now in that it makes a few references to this procedure not being possible for the web player plugin, but fortunately I didn't find this to be the case.

In case you're too lazy to read the whole tutorial (which covers more than just adding missing keyboard shortcuts), here is a condensed version to suit our needs:

1) navigate to where your remote control skin is stored and identify your '.spr' file.

Since we are dealing with the Mac web player plugin here, the remote files can be found here:

/Users/<username>/Library/Application Support/SlingMedia/Remotes

(Obviously you need to substitute <username> for the short form of your OS X username.)

In my case, since I'm using a Sky+ HD box, it was the file 'SkyHD.spr' that I was interested in.

2) go back to placeshiftingenthusiasts.com and search for the equivalent '.zip' file

Essentially the problem here is that we can't edit the 'SkyHD.spr' file directly because these days Sling encrypt these files (apparently they used not to), so instead we need to find the file 'SkyHD.zip' that the folks at PCE have created and archived here:

Slingplayer Remote Skin Files

Once you've found the right file, unzip this somewhere on your machine.

3) still at placeshiftingenthusiasts.com, locate the global 'property.xml' file

Slingplayer 'property.xml' file

Now place this file inside the folder containing all the files you unzipped earlier.

4) double-click the 'remote.xml' file to open it, or otherwise open it in TextEdit

This file contains the mappings and keyboard shortcuts for your remote and what we need to do is locate the section containing the keyboard shortcuts and add the missing ones.

In my case, this section was at the end and here is how my 'remote.xml' looks after I've edited it. I've highlighted the ones I added in blue:

Adding the missing keyboard shortcuts
As you can see, I have added extra lines for each of the keyboard shortcuts that I discovered were missing earlier.

One thing to be careful of here is making sure you don't re-assign the same keyboard shortcut to more than one button on the remote. Importantly, when checking for such clashes, you also need to check the 'property.xml' file for keyboard shortcut assignments too as many of the basic ones are defined in this file.

5) zip up all the remote skin files into a replacement ZIP archive

Now that you've added the missing shortcuts you just need to zip them back up. You can do this by selecting them all and then right-clicking on the selection and choosing 'Compress X items'.

You will need to rename the 'Archive.zip' file that this operation produces so that it matches the name of the '.zip' file you downloaded. In my case this was 'SkyHD.zip'.

However, before we can use this replacement file we need to change its extension from '.zip' to '.spr' so that the web player plugin can find it.

The best way to do this is to select it, press Cmd+I to pop-up its info and then in the 'Name & Extension' edit box just delete the '.zip' and replace it with '.spr'.

You will probably get a prompt asking you if you really want to do this, to which the answer is a resounding yes!

6) copy the new '.spr' file over the top of the old '.spr' file and lock it

I would recommend that before you do this that you backup the old '.spr' file inside the Remotes folder, just in case something goes wrong.

Then you just need to replace the old '.spr' file (in our case 'SkyHD.spr') with the one we have created.

Unfortunately I found that this alone was not enough to force the web player plugin to use the new remote - for some reason it will try and override your newly-created file with the one from Sling's servers and the only way I have found to stop this happening is to lock the new one. I'm guessing there is some kind of checking done that means the plugin thinks the one stored on Sling's servers is preferred. (Perhaps Sling could make a small but useful change here - how about making the plugin search first for 'SkyHD.zip' and if it finds that then use it instead?)

Anyway, the easiest way to lock it is to select it, chose Cmd+I again to popup its info and then tick the 'Locked' check box.

Now all that remains is to test what you have done by going to watch.slingbox.com again (it might be wise to quit and re-open your browser first), click on the 'Remote' button and verify that when you hover over all the buttons that the correct keyboard shortcuts are now shown!

2 comments:

  1. Did Sling ever allow customized remotes on the web interface? Thanks in advance!

    ReplyDelete
  2. Oops - Didn't click Notify Me on my prior post. :)

    ReplyDelete