KeyControl v1.02
- Released 4 October 2006 -
© Copyright 2001-2006 Paul Mah

contents
 
  1. Introduction
  2. About KeyControl
    - History
    - License
  3. Acknowledgements
  4. Using KeyControl
    - Creating New Shortcuts
    - Selectable Keys
    - Committing Changes
    - Gobble Keys
    - Uninstalling
  5. Supported Actions
    - Action List
    - Traverse Directory
  6. Known Issues
    - Multiple Instances of Winamp
  7. Contact Me


1

  Introduction

KeyControl is a Winamp plug-in that gives you configurable system-wide keyboard and mouse 'Shortcuts' to control Winamp. This is achieved by associating your shortcuts to a list of pre-defined 'Actions'. Currently supported Actions include many of Winamp's existing features such as Play, Pause, Stop, Change Track and Change Volume among others. KeyControl also offers features not inherent to Winamp like PGM [Programmable Mode], where Winamp will continuously replay a selected track in the playlist.

You will find all these features useful, especially FPS games where every second is crucial. But even if you are not a gamer, you should find KeyControl handy as well. It gives you one-button control of many of Winamp's functions, freeing you from having to move your hands away from the keyboard (or mouse).

Besides supporting the keyboard, KeyControl can also be configured to respond to the scroll feature of your wheel mouse or to your mouse buttons. It also provides the Windows key as a modifier as well. In fact, since 2001 when it was first released, KeyControl is still the only plugin that provides mouse and Win-key feature!

 

2

  About KeyControl

History

KeyControl came about as a result of a desire to listen to MP3s while playing Half-Life -- Counterstrike.  While I could do that, I had to manually switch to my desktop before I could make any adjustments to Winamp.  Moreover, switching around when in a session of gaming on my rig normally results in the game losing its sound.  This was clearly unacceptable.  After searching in vain for a similar solution, and having looked at the Winamp API, I decided to write my own.  Thus KeyControl was born.

The first release was KeyControl v0.91 beta, released in June 2001.  It came with only the basic Actions and without any form of support for the mouse.  KeyControl 1.0 beta on the other hand, was re-written and is a realization of the original feature set (and more) that I had envisaged for KeyControl.

KeyControl was written and tested on a Win98SE box. Since then, I have upgraded to Windows XP and have continued using it through the years without any issues.

License

KeyControl is copyrighted FREEWARE.  You are free to download, install or use KeyControl on any number of computers.  Ownership of the software however, remains solely with the author, Mah Meng Poh, referred to as "Paul Mah" in this documentation and any Email correspondence.  

KeyControl is provided 'as-is', without any express or implied warranty.  In no event will the author be held liable for any damages arising from the use of this software.

KeyControl may be distributed in its unmodified form, inclusive of this documentation in its original installation file via Internet archives that do not impose any charges for downloading.

KeyControl may also be distributed in its unmodified form, inclusive of this documentation in its original installation file, via physical storage media such as, but not limited to, DVD-ROM, CD-ROM, CD-R, CD-RW, Zip Disk, Floppy Disk, provided no charges beyond the cost of the distributing media is leveraged, and in quantities of not more than 1,000.

Distribution of KeyControl via any type of physical storage media exceeding quantities of 1,000 requires the author's consent.

 

3

  Acknowledgements

Thanks also to Daniel Tveraa-Olsson for his posting on detecting the loading of new songs in winamp-plugin-dev.  It made fast-forwarding into the next song possible. 

 

4

  Using KeyControl

Creating New Shortcuts

All shortcuts are defined through the Keys textbox (1) under the New Shortcuts portion of the KeyControl dialog.  Shortcuts are defined by clicking in the textbox and then tapping the key that you wish to use.  In the below example, an Alt-Num 0 ('0' from the numeric pad) shortcut will be created when the 'Add' (4) button is clicked.  Tapping the Alt-Num 0 key henceforth will activate the associated 'Mute | Unmute' Action (3).

Selectable Keys

All the keys on your keyboard should be selectable, though there are some limits and pointers that you should be aware of:

  1. KeyControl does not differentiate between CAPITAL and small-lettered keys. This includes keys that can generate different characters e.g. 1 and !, 2 and @.  Generally every physical key on your keyboard is counted as one key.  (The numeric keypad is an exception)
  2. The only keys that cannot be defined as Shortcuts are the Alt, Ctrl, Shift and WinKey (Version 1.02b onwards) keys.  They can only be used as modifiers (2) to define totally different Shortcuts.  Make good use of them.
  3. Wheeled mouse is supported.  Just as for keyboard shortcuts, simply scroll the wheel forward or backwards when the cursor is in the Keys textbox (1) to register it as a shortcut.
  4. All three buttons (Left, Middle, Right) mouse buttons are supported.  Double-click them in the above-mentioned textbox to register them.
  5. You are not allowed to define the same Shortcut twice.
  6. There is a hard-coded limit of 30 keyboard shortcuts and 10 mouse shortcuts. This is more than enough for me, but if it is otherwise for you, feel free to Email me.
  7. Keyboard Shortcuts are always grouped at the top and mouse Shortcuts at the bottom of the Existing Keys listbox (5).
  8. To remove a Shortcut just select the relevant entry under Keys (5) and click the Delete button.  There is currently no way to modify a Shortcut's associated Action if it has already been defined.  Simply Delete, then Add again.

Committing Changes

Selecting "Ok" will commit all the Shortcuts (5) to disk.  All Shortcuts and their associated Actions are saved in the plugin.ini file, which can be found under the plugins directory wherever you've installed Winamp.

Selecting "Cancel" will clear all currently defined Shortcuts and reload the old settings from disk.

Gobble Keys

Setting Gobble Keys will cause KeyControl to prevent other applications from receiving any input that matches existing Shortcuts from your keyboard or mouse, effectively 'gobbling' them up.

It is useful in several ways.  If you happen to dedicate your entire Numeric Pad to Shortcuts, it prevents applications like your favorite word processor or spreadsheet from being messed up with unwanted numbers when you try to forward to a certain song.

Or perhaps you would like to create some of your own Shortcuts based on Winamp's.  However, if Winamp is in focus, you will realize that setting Numeric 6 as Next Track will result in 2 Next Track being processed, once by KeyControl, and another time by Winamp itself.  Setting Gobble Keys will eliminate this problem by preventing Winamp from receiving the key-press.

Uninstalling

There are a few ways to uninstall KeyControl.  The recommended way would be to go to Control Panel -> Add / Remove Software and look for "KeyControl vx.xx (remove only)".  Click on "Add / Remove..." next and you are on your way.  The alternative would be to call the uninstaller directly.  It is named uninstall-KC.exe and is located in your <Winamp>/plugins/KC directory. 

You can also remove KeyControl by deleting the gen_KeyControl.dll file in the <Winamp>/plugins directory as well as deleting the entire <Winamp>/plugins/KC directory.  This, is not recommended however, as it would not remove the registry string that allows you to uninstall from the Control Panel.

Note that as of Winamp 2.77, you can uninstall plug-ins directly from Winamp Preferences -> Plug-ins -> General Purpose.  This only removes the gen_KeyControl.dll file and is also not recommended.

All settings written by KeyControl are saved in the plugin.ini file found in your <Winamp>/plugins directory.  They will have to be removed manually. 

 

5

  Supported Actions

Action List

Below is an exhaustive list of the current Actions that KeyControl supports together with a description of what they do.  Suggestions for new Actions are always welcomed.

  Action   Description  
  Play   Starts Playback  
  Stop   Stops Playback  
  Pause   Pauses Playback  
  Previous Track [Winamp-Style]   Skips to the previous track  
  Previous Track [CD-Player Style]   Skips to the previous track, or back to the beginning of the same track if started within the first 3 seconds of a new track, emulating a CD-Player  
  Next Track   Skips to the next Track  
  Fast Forward   Forwards playback position of current track  
  Fast Rewind   Reverses playback position of current track  
  Volume Up   Increases the Volume  
  Volume Down   Decreases the Volume  
  Mute | Unmute   Toggles between mute and restoring the volume.  Attempts to modify the volume in any way will cause KeyControl to 'forget' the original volume.  
  Max Volume   Sets maximum volume  
  Show | Hide Winamp   Toggles between minimizing and restoring Winamp  
  Restart Winamp   Restarts Winamp  
  Exit Winamp   Exits immediately from Winamp  
  Set Shuffle   Sets Winamp Shuffle to On  
  Unset Shuffle   Sets Winamp Shuffle to Off  
  Set Repeat   Sets Winamp Repeat to On  
  Unset Repeat   Sets Winamp Repeat to Off  
  Set PGM   Activates Programmable Mode on currently selected / playing track.  If already playing, current track will replay continuously until PGM is deactivated.  Directory Traverse will deactivate PGM.  
  Unset PGM   Deactivates Programmable Music Mode  
  Next Directory   Traverse to the next directory
(A more detailed explanation below)
 
  Previous Directory   Traverse to the previous directory  
  Deactivate KeyControl   Deactivates KeyControl.  A manual activation is required via the KeyControl dialog to enable KeyControl again  
  Open CD-Tray   Opens the CD-Tray (if any) of the designated CD-Audio device  
  Close CD-Tray   Closes the CD-Tray (if any) of the designated CD-Audio device  

 

Traverse Directory

Traverse Directory was designed to allow you to sort your music in a simple, yet useful way - via directories. A typical collection might consist of MP3 tracks from various genres, singers or albums. The directory layout for a collection sorted by genre might look like this:

    D:\Music\Classical
    D:\Music\Pop
    D:\Music\Rap
    D:\Music\Rock

The first invocation of "Next Directory" will load all Winamp playable files in the D:\Music\Classical directory into the Playlist.  A subsequent "Next Directory" will load all the files from D:\Music\Pop and so on.  Advancing past the last directory (D:\Music\Rock) will cause the first directory to be loaded.

The 'root' directory in the above example would be the D:\Music directory.  To set the root directory, right click on any of Winamp's Windows and select Play -> Directory from the pop-up menu.  This should bring up Winamp's "Open Directory" dialog.  Select the root directory that you want.  There is no need for "Recurse subdirectories" to be checked.  Once done, restart Winamp so that Winamp will write the settings to disk for KeyControl to read.

On restart, activating a Shortcut associated to either "Next Directory" or "Previous Directory" should cause Directory Traverse to traverse accordingly.  KeyControl remembers the last directory you were at as well as the last song that was playing.

There is no limit to the number of directories that you can have.


list.  A subsequent "Next Directory" will load all the files from D:\Music\Pop and so on.  Advancing past the last directory (D:\Music\Rock) will cause the first directory to b6

  Known Issues

Multiple Instances of Winamp

KeyControl was not designed to work with multiple instances of Winamp. It will only control the first copy of Winamp that was started.


list.  A subsequent "Next Directory" will load all the files from D:\Music\Pop and so on.  Advancing past the last directory (D:\Music\Rock) will cause the first directory to b7

  Contact Me

I can be reached at paulmah@gmail.com or feel free to visit littlesandpit.blogspot.com for updates on KeyControl.