Useless Keys v1 March 2006 wrybread@gmail.com http://wrybread.com/utilities Personally I never ever use the numpad, and for some strange reason every keyboard has one. You'd think someone would make a keyboard that's otherwise completely standard (big backspace key and conventional arrow keys are a must), but without a numpad. But alas. Anyway, hence Useless Keys, "the multimedia keyboard for the rest of us". It lets you assign functions to the Function keys, the Print Screen key, the Scroll Lock key (what the hell is that key supposed to do anyway?), the Pause key, up to 10 user-defined keys for assigning more useful functions to the multimedia buttons, and for now it lets you use the numpad to control Winamp. I'll probably make the numpad more configurable in the future, email me if there's something you'd like it to do. --------------------- USAGE --------------------- Run Useless Keys.exe and it'll show up in your system tray. You can right-click it for a few options. --------------------- NUMPAD AND WINAMP --------------------- Here's what it does to Winamp (if Winamp wasn't running when you launched Useless Keys, press the ESC key twice to get it to control Winamp. That'll be fixed soon): Numpad 8 and Numpad 2 = volume up and down Numpad 4 and Numpad 6 = previous and next track Numpad 1 and Numpad 3 = seek forward and backwards Numpad 5 = pause Miscellaneous: Numpad + = Eject cd drive Numpad - = Close CD drive (you need to tell uselesskeys.ini the drive letter of your CD drive) ----------------------------- LAUNCHING PROGRAMS OR FILES ----------------------------- Here's how Useless Keys launches programs or files: You can set the function keys and the remaining numlock keys to launch programs or files using uselesskeys.ini. There's a bunch of instructions there, but the gist is this example would set the F1 key to launch Winamp: f1 = "c:\program files\winamp\winamp.exe" Note the parameter below that, called "f1_block". Setting that to "yes" means Useless Keys will prevent the F1 key from reaching Windows, and setting it to "no" means it lets the keystroke pass. So the following parameters would launch Winamp and prevent the F1 key from reaching Windows: f1 = "c:\program files\winamp\winamp.exe" f1_block = "yes" Be careful in the config file, it's really touchy, if your config file has an error it'll crash the whole program. If your config file gets corrupted, your best bet is probably to reinstall a backup or the default version. If you're leaving something blank in the config file, make sure it has an open quote and close quote. For example if you want f1 to do nothing, make sure it still says: f1 = "" I know, it's silly, I'm working on that. Also, if you're launching a file, you need to launch it with another application. For example, if you're trying to launch c:\somesong.mp3, you need to launch it like this: f1 = "c:\program files\winamp\winamp.exe c:\somesong.mp3" I'm working on that one too. --------------------- USER-DEFINED KEYS --------------------- At the bottom of uselesskeys.ini is the user-defined key section. The entries look like this: key1 = "" key1_launch = "" key1_block = "no" Next to key1 you need to put the scancode of the key you're trying to assign. To find out the scancode of a given key, press the key you're interested in, and then right-click the Useless Keys icon in the system tray and select "show scancode for last key pressed". Note that this window doesn't refresh, if you want to see another scancode, close that window, then press the key you're interested in, then right-click Useless Keys and choose "show scancode for last key pressed" again. For example, if you were trying to assign the TAB key to a function, you'd press TAB, then right-click Useless Keys and select "show scancode for last key pressed", and it would tell you the scancode for the TAB key is "9,15,0". You'd paste that in like this: key1 = "9,15,0" key1_launch = "c:\program files\winamp\winamp.exe" key1_block = "no" The above would launch Winamp when the TAB key is pressed, and not block the keypress, meaning other applications can receive the TAB key. I'm pretty sure it'll work with most keys on multimedia keyboards, but I'm not sure since I don't have one. --------------------- STICKERS --------------------- There's a sticker template in the program directory, you can print it on Avery 5264 labels then cut them up to put them on your num pad and function keys. I whipped it out pretty quickly, and they're for the configuration I'm using, so consider them a first draft. If you make a template, email it over and I'll post it. --------------------- KNOWN ISSUES! ARGH! --------------------- - It seems to have a problem where if Winamp is minimized it doesn't always catch the commands. - If Winamp isn't running when you start Useless Keys, you need to either restart Useless Keys or select Grab Winamp from the right-click of Useless Keys's system tray icon, or press the ESC key twice. - As I said above, you can't launch files directly, you need to specify what application is launching the file, and that application needs to be able to accept the command line argument. See the notes below for some help on that. --------------------- Notes: --------------------- - it doesn't care if numlock is on or off. - pressing ESC twice reloads your config file and tries to grab control of Winamp. - you can pass commandline parameters to programs you're launching. - for more control over Winamp you might look at the commandline utility clamp (http://membres.lycos.fr/clamp/), which works well with Useless Keys. For example, to set the numpad1 key to play Winamp, you'd put in uselesskeys.ini f1 = "c:\clamp.exe /play" - if you have the problem where you can't control Winamp when it's minimized, let me know. I might ditch my method of controlling Winamp and use Useless Keys to control Clamp, since that seems to work flawlessly. - To execute shell commands, use the following format: "COMMAND.COM /C [shell command]". For example, to execute the command "del c:\whatever.txt" when you press F1, you'd put: f1 = "COMMAND.COM /C DEL C:\filename.txt" - feel free to email me question or suggestions, or post them on wrybread.com/utilities. --------------------- Tips: --------------------- Here's some command-line ways of launching certain types of files. In the below examples, you're assigning the F1 key to do these things: Webpages: f1 = "C:\Program Files\Mozilla Firefox\firefox.exe http://google.com" Textfiles: f1 = "notepad c:\whatever.txt" Directories (note there's no training backslash): f1 = "explorer.exe c:" f1 = "explorer.exe c:\whatever" Images: Install Irfanview (irfanview.com) if you havn't already. Then: f1 = "c:\program files\irfanview\i_view32.exe c:\whatever.jpg" Print an image: f1 = "c:\program files\irfanview\i_view32.exe c:\whatever.jpg /print" Also, you might look at the Clamp manual, it's got some really great control for Winamp. It's here: http://membres.lycos.fr/clamp/ My favorites: (All these examples assume you put clamp.exe in the root of your C drive. If you put it elsewhere, adjust the patch in each of these). Toggle random mode: c:\clamp.exe /random Clear playlist: c:\clamp.exe /plclear Toggle always-on-top status: c:\clamp.exe /ontop Start winamp if it isn't running: c:\clamp.exe /start And NirCmd lets you do lots of slick things with Useless Keys: http://www.nirsoft.net/utils/nircmd.html Turn down system volume by 5000 units: c:\nircmd.exe changesysvolume -5000 Turn up system volume by 5000 units: c:\nircmd.exe changesysvolume +5000 Change screen resolution to, for example, 800 x 600 24bit: c:\nircmd.exe setdisplay 800 600 24 Open CD rom drive d: c:\nircmd.exe cdrom open d: Wizmo does lots of neat things: http://grc.com/wizmo/wizmo.htm Reboot the computer: c:\wizmo.exe quiet reboot Reboot the computer and ignore any "do you want to save this" dialogs: c:\wizmo.exe quiet reboot! Turn off computer monitor: c:\wizmo.exe quiet monoff Mute audio: c:\wizmo quiet mute=1 Unmute audio: c:\wizmo quiet mute=0