Pages

Monday 15 November 2010

Sky Plus Remote Control


The Sky+ set top box is Java powered, and this has the happy side effect of allowing parts of the functionality on a PC for testing.

Unfortunately this wasn't particularly user friendly. Each button on the remote control was mapped onto a QWERTY keyboard, and not all of these were obvious. So the management decided that a GUI component was needed.

The remote was implemented as an AWT custom component. A high resolution image of the control, as shown in this post, was displayed in a window, and a mouse listener was used to pick up whether a hot spot corresponding to one of the buttons had been clicked.

These hot spots stored associated Java virtual key codes. These would be passed in an event to the existing handler code, spoofing a key being pressed on the keyboard, and triggering the desired command in the set top box menu system.

In order to give the user feedback, a highlight would be drawn over the pressed button. And the red light at the top of the controller would glow until the click was released. That's the feature that everyone noticed!

The trickiest part of the project was launching the controller. Because the set top box code ran in a limited environment much of the standard Java libraries were missing. Oh, and James or Rupert Murdoch probably wouldn't appreciate me adding extra code to support this.

The solution involved catching an obscure event that was broadcast when the frame containing the menu screen was displayed. This was then used to display the controller onscreen, and avoided making changes to the live system.