Wednesday, June 24, 2009

Control Your HTPC With EventGhost

Controlling your HTPC with the 10-foot interface (aka remote control) is one of the first things you need to figure out when setting up the HTPC.  Some HTPC programs have built-in ways to deal with this, but even then you might need a little more power or control.  EventGhost is a very nice freeware that helps you do this and ZetaVu has written the following guest-post explaining how he set up EventGhost to control his HTPC.  Read on for a great how-to article:

NOTE:  This is a guest post by ZetaVu, a GeekTonic reader and frequent guest-blogger on GeekTonic.  Basic guidelines for writing and submitting a guest post at GeekTonic can be found here.

I had been an avid user of Girder with my remotes on my HTPC. My main programs are Snapstream Beyondtv and Media Portal, but have also used Beyond Media when it was actively supported. My goal was to program the same remote buttons to have similar functions in either program (as well as Firefox Keyconfig shortcuts). The remotes I use are an ATI All in Wonder RF remote, and the Hauppauge IR remote that came with my HVR 1600 capture card. The reason I used Girder was that it let me assign custom actions to any button on my remotes. The reasons I stopped using Girder were 1. it was proprietary, not open source, and 2. I could not get a decent plugin for my Hauppauge remote, not all the functions worked.

Then along comes Evenghost.  Eventghost is an open source application, free to use and supported by a decent group of developers. Since it is open source there are no limitations to creating plugins for it. Looking through the EventThost plugin directory, I was able to find input plugins for both my remotes, as well as output plugins for Media Portal, Sagetv, PowerDVD etc. I had thought about writing a plugin for Beyondtv, however since I did everything in Girder using keyboard shortcuts, I decided to stick with that. This is my step by step instructions on getting Eventghost to work with my HTPC. Other remotes could be substituted as well as other programs.

First off, you will need to download one of the nightly builds to get full Hauppauge support. I started with build 3.6.1487, there is a more recent one I haven't tested yet. Get the EventGhost builds here . You will also need the drivers for your remotes. I installed the ATI remote-wonder-2-5-0-0-english.exe program normally (having it launch on startup) and the Hauppauge ir32_257_26021.exe program, but disabled the automatic launch in the startup folder. (don't need it) Then I installed Eventghost. Now, Girder had a feature to have it launch minimized, I did not see this in the Eventghost options, so instead I made a shortcut to launch it in my Startup folder, and told the shortcut to launch the program minimized.

Now comes to the fun part, customizing Eventghost. First thing is to add the plugins for the remotes.

Adding Plugins to EventGhost

In the right pane, under Configuration Tree, right click Autostart, and select add plugin. Here choose the remote plugins you will use (I added The Hauppauge, generic X10 for the ATI is there by default). Next step is to add all the commands you are going to use. There are sample commands further down in the right pane under Content Folder. Since I am doing keyboard emulation I selected that folder. Under there are various Macros such as Up Down, Play etc.

Adding commands and Macros to EventGhost

 

You can add additional Macros by right clicking the Keyboard Emulation folder and selecting Add Macro. You can also copy and paste macros, which will give you all events and actions under the macro. Likewise, you can add events (commands from remotes, etc) or actions by right clicking the macro

Adding Macros to EventGhost

To make things simplest, I copied one macro over and over and then renamed the macros to get my full list of commands. The following table lists all the commands I send to both Media Portal and Beyond TV. These are default settings for Beyondtv, however in Media Portal I changed several of the shortcuts to be consistent with Beyondtv. To do this, you need to edit the Keymap.xml file in the TeamMediaPortal folder. Alternatively, you can assign specific commands for each program (to do this you will need to read the short manual – http://www.eventghost.org/wiki/Short_Manual) but I like to keep things simple.

Keyboard Shortcut Beyondtv Media Portal
P Play Play
S Stop Stop
space Pause Pause
' (apostrophe)   Fast forward
; (semicolon)   Rewind
. (period) Skip Forward Next
, (comma) Skip Backward Previous
Up Up Up/Big Jump Forward
Down Down Down/Big Jump Backward
Left Left Skip Backward
Right Right Skip Forward
Enter Enter Enter
Home Menu Parent Directory
Esc Back, Exit Back
O Options Menu Toggle Playlist/Menu
R Record Add/Remove Playlist
Alt-F4 Shut Down BTV  Shut Down MP
] (end bracket) Channel Up Page Up
[ (open bracket) Channel Down Page Down
#NAME? Volume Up Volume Up
#NAME? Volume Down Volume Down
Alt-Tab Switch Between Programs  
F Fullscreen Visualizations  
Start Program Btvd3dshell.exe Mediaportal.exe

More keyboard shortcuts can be found here:

 

I name the macros with both the general function and the keyboard function, So Play->P is Play, shortcut P. Under the macro I create either an Emulate Keyboard or Start Application action

Then I edit the action as needed, either entering the shortcut or the path the the program to launch.

Last step is to add the events to each macro. The easiest way to do this is to just press a botton on the remote you want to assign to the macro. The event appears in the left pane when you press it. You can then drag this event to the macro you want to assign it to. For most commands, I have two events, one for each remote (some of the ATI commands don't need eventghost, such as the button keys, etc).

Now, I don't use my Hauppauge remote itself, instead I use a universal learning remote that's programmed for my entire home theater. The Hauppauge remote keys are available as one of the Toshiba VCRs (trial and error to find one that works the best). I use a Universal RF10, so I just learned the keys so I could put them wherever I wanted. With the Hauppauge, since the remote program is not running in the background (just the dll) you will need to assign all the keys, including the numbers.

And that's about it. Once you've assigned all the macros, events and actions just save the config file and you should be ready to go. Mind you, this is just scratching the surface of what you can do with Eventghost. You can link it with a UsbUIRT to control all your devices, set it up with an X10 or Smarthouse control, have it launch events and respond to events, etc. You can also program different commands based on running applications. Like I said, I like things simple so the keyboard shortcuts works for me. Now I have the option of controlling my HTPC with my home theater universal remote, or using my Remote Wonder as a remote and wireless mouse. I also have some interactive remote control programs that I run through my PDA, but we'll save that for another article.

 

About the author:  "ZetaVu is a frequent commenter and Guest-Poster at GeekTonic with a great deal of knowledge with HTPC's and other media gadgets.  I've gotten to know him from the many hours spent on the Snapstream, MediaPortal , AVS and other Forums where you'll often find him (under the same online name).  His past guest posts include iPod Without iTunes, Video Editing Power Tools, and MediaGadget Showcase for his setup all of which are great reads.