Connecting your multimedia keys to SoundPlay
a tutorial by Stephen van Egmond.
Requirements:
- (As of BeOS R5.0.3) An AT or PS2 keyboard with multimedia keys.
The magic keys on USB keyboards don't work.
- SoundPlay installed
- SpicyKeys installed
- hey installed in /boot/home/config/bin/
Step one: make sure your multimedia keys are recognized
Start SpicyKeys' configuration tool, and click on "add a new key". Click on
the little representation of the hotkey, and press each of your multimedia keys,
ensuring that the keycode shown changes for each one you press.
If you press a key that's not recognized, the keycode simply doesn't change. If
that happens, and you would really like to use that key, here's what to do:
- Read Nathan Shrenk's article
called "Advanced Keyboarding".
- Download his KeyboardMapper.
- Back up your current keyboard driver and install Nathan's keyboard driver and restart
the input server. This assumes you expanded KeyboardMapper into /tmp:
cp /boot/beos/system/add-ons/input_server/devices/keyboard /tmp
cp /tmp/KeyboardMapper/keyboard /boot/beos/system/add-ons/input_server/devices/keyboard
/system/servers/input_server -q
- Open /boot/home/config/settings/AT_Keyboard_Info in a text editor.
- Push a multimedia key. If it's not recgnized, you'll get a dialog box telling you the scancode
of the unrecognized key.
- The file you have open maps keyboard codes from the arcane 8-bit AT world to the modern
32-bit BeOS world. It also takes comments. So, for instance, if you're told that your "my computer" key has
scancode 0xeb, add a line like this to the scancode file (usually at the bottom):
0xeb 0x1000eb # my computer
Just adding 0x100000 to the keycode to make the BeOS code should be safe.
- Repeat for each unmapped key.
- When you're done, put back your keyboard driver:
cp /tmp/keyboard /boot/beos/system/add-ons/input_server/devices/keyboard
/system/servers/input_server -q
There, your multimedia keys should all be recognized in SpicyKeys now.
Step two: Install the scripts provided
Take the "scripts" directory included in this distribution and drop it in /boot/home/config/ .
The scripts provided are:
- next and prev
- Skip to the next and previous track of SoundPlay
- mute
- When first run, mutes the audio from SoundPlay. When run again, un-mutes the audio.
- pause
- When first run, pauses the audio playback. When run again, it resumes playing.
- ffwd and rew
- When first run, these start playing the audio really fast forwards or backwards. When run again,
they resume normal playback.
- volumeup and volumedown
- Bump the volume up and down by about 20%.
- fwd30 and bak30
- Skip forwards or backwards 30 seconds in the playback, instantly.
Configure SpicyKeys to call these scripts
This part is easy. Use SpicyKeys' pretty intuitive interface to create calls to these
scripts. You have to provide the full path into /boot/home/config/scripts/. Save your changes. Enjoy.