How To: Creative Remotes
Posted: 15 Jan 2007 11:34
I had a bit of a hard time figuring out how to get my Creative Remote (RM-1000) to work with VLC. I finally got it working, but noticed that when I searched this forum, I only found questions with no answers. So, I decided to write up a little guide.
First of all, this should be compatible with any Creative sound card + remote. Secondly, you need to be running the Creative Remote Center. Thirdly, I'm not going to give exact keymap settings, because they vary by remote model and your VLC hotkeys.
Step 1 - Open (your remote).RCI file
Find the directory you installed Creative Remote Center in and navigate to /Rc/RCRx. Open the .RCI file with the name of your remote with your favorite text editor. Notepad works for me. This file contains 2 sets of values you will need: MMCDEvent numbers, and KeyNames.
MMCDEvent=#### represents the code sent by the remote when a key is pressed.
KeyName='somestring' is the name of the key that was pressed.
OneShot=# is unimportant for our purposes. It just changes whether the button should send multiple signals while held down, or just a single button press signal.
Step 2 - Create wxWindowClassNR.key file
From the Creative Remote Center install directory, navigate to /Rc/KeyMap. Create a file called wxWindowClassNR.key. This file will contain the keymappings to control VLC. It's going to look like a windows registry file, but just open it with notepad.
The name of the file tells Creative Remote Center what keymap to use when a window with the name of the file has focus. In this case, wxWindowClassNR is the internal name of the VLC main window.
Step 3 - Make the file header
Easiest way to do this is to open Default.key and copy the first 7 lines to your .key file. You only need to change the second line to the following:
Name=wxWindowClassNR - because that's the name of the VLC main window.
Step 4 - Map your keys
From VLC, open the preferences and look at the Hotkey settings. For the buttons you want to map to the remote, look up the keyboard key's decimal ASCII representation. This should help. Those values are in hex, so watch out! Also, you can only map single keyboard keys, so don't use any Alts, Ctrls, or Shifts.
Step 5 - Each keymap entry is going to follow a simple format:
[KeyEvent####] - #### corresponds to MMCDEvent in the .RCI file.
KeyName="somestring" - "somestring" is what will be displayed when you mash that button on the remote.
Notification=# - # can be one of several values, but for our purposes should just be -1.
KeyEventRemap=## - ## is a decimal ASCII value that corresponds to the keyboard key you want the button mapped to.
A full keymap entry will look like this:
[KeyEvent6906]
KeyName=Kill All Humans
Notification=-1
KeyEventRemap=32
This maps the '6' button on my remote (MMCDEvent 6906) to the keyboard key 'Space Bar' (ASCII 32) and displays "Kill All Humans" (key name) when using VLC.
Whether that does anything in VLC is depends on if I've mapped the space bar to do anything in VLC. If I've mapped fullscreen mode to 'space bar', then pressing the '6' on the remote would toggle fullscreen mode and display "Kill All Humans". Not the most intuitive control, but whatever floats your boat...
Step 6 - Write entries in the key file
We're almost done! Now, for each remote button you want to map, follow the format outlined in step 5. Not hard, but probably the most tedious step. Copy and Paste are your friends!
Step 7 (optional) - VLC DirectX.key file
I had a little bit of trouble once when using fullscreen mode. Sometimes, the fullscreen window gained focus, while the VLC main window (with the player controls) lost focus. This prevented using the remote, because it only controls a window that has a keymap file (the controls window) and has focus.
The way I fixed it, was creating an identical keymap file to wxWindowClassNR.key and calling it "VLC DirectX.key" Change the second line in the file to Name=VLC DirectX. This is the internal name of the rendering window.
Certain buttons won't automatically map, because of settings in Default.key. Some keys are the volume, mute, and eax keys. You can override them by making changes in the Default.key file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I hope this helps anyone struggling to get the remote to work. You can use the same method to control any app with the remote as long as you know the internal window name. I used Spy++ to get the window class names for VLC (wxWindowClassNR and VLC DirectX) and it's easy enough to get the names for any others.
First of all, this should be compatible with any Creative sound card + remote. Secondly, you need to be running the Creative Remote Center. Thirdly, I'm not going to give exact keymap settings, because they vary by remote model and your VLC hotkeys.
Step 1 - Open (your remote).RCI file
Find the directory you installed Creative Remote Center in and navigate to /Rc/RCRx. Open the .RCI file with the name of your remote with your favorite text editor. Notepad works for me. This file contains 2 sets of values you will need: MMCDEvent numbers, and KeyNames.
MMCDEvent=#### represents the code sent by the remote when a key is pressed.
KeyName='somestring' is the name of the key that was pressed.
OneShot=# is unimportant for our purposes. It just changes whether the button should send multiple signals while held down, or just a single button press signal.
Step 2 - Create wxWindowClassNR.key file
From the Creative Remote Center install directory, navigate to /Rc/KeyMap. Create a file called wxWindowClassNR.key. This file will contain the keymappings to control VLC. It's going to look like a windows registry file, but just open it with notepad.
The name of the file tells Creative Remote Center what keymap to use when a window with the name of the file has focus. In this case, wxWindowClassNR is the internal name of the VLC main window.
Step 3 - Make the file header
Easiest way to do this is to open Default.key and copy the first 7 lines to your .key file. You only need to change the second line to the following:
Name=wxWindowClassNR - because that's the name of the VLC main window.
Step 4 - Map your keys
From VLC, open the preferences and look at the Hotkey settings. For the buttons you want to map to the remote, look up the keyboard key's decimal ASCII representation. This should help. Those values are in hex, so watch out! Also, you can only map single keyboard keys, so don't use any Alts, Ctrls, or Shifts.
Step 5 - Each keymap entry is going to follow a simple format:
[KeyEvent####] - #### corresponds to MMCDEvent in the .RCI file.
KeyName="somestring" - "somestring" is what will be displayed when you mash that button on the remote.
Notification=# - # can be one of several values, but for our purposes should just be -1.
KeyEventRemap=## - ## is a decimal ASCII value that corresponds to the keyboard key you want the button mapped to.
A full keymap entry will look like this:
[KeyEvent6906]
KeyName=Kill All Humans
Notification=-1
KeyEventRemap=32
This maps the '6' button on my remote (MMCDEvent 6906) to the keyboard key 'Space Bar' (ASCII 32) and displays "Kill All Humans" (key name) when using VLC.
Whether that does anything in VLC is depends on if I've mapped the space bar to do anything in VLC. If I've mapped fullscreen mode to 'space bar', then pressing the '6' on the remote would toggle fullscreen mode and display "Kill All Humans". Not the most intuitive control, but whatever floats your boat...
Step 6 - Write entries in the key file
We're almost done! Now, for each remote button you want to map, follow the format outlined in step 5. Not hard, but probably the most tedious step. Copy and Paste are your friends!
Step 7 (optional) - VLC DirectX.key file
I had a little bit of trouble once when using fullscreen mode. Sometimes, the fullscreen window gained focus, while the VLC main window (with the player controls) lost focus. This prevented using the remote, because it only controls a window that has a keymap file (the controls window) and has focus.
The way I fixed it, was creating an identical keymap file to wxWindowClassNR.key and calling it "VLC DirectX.key" Change the second line in the file to Name=VLC DirectX. This is the internal name of the rendering window.
Certain buttons won't automatically map, because of settings in Default.key. Some keys are the volume, mute, and eax keys. You can override them by making changes in the Default.key file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I hope this helps anyone struggling to get the remote to work. You can use the same method to control any app with the remote as long as you know the internal window name. I used Spy++ to get the window class names for VLC (wxWindowClassNR and VLC DirectX) and it's easy enough to get the names for any others.