Spanky’s fav Autohotkey codes, part 2

On my aging Dell laptop, they provided a special “internet key”–it launched a browser when I first got the system. It’s akin to these guys in the silver oval:

keyboard

But, as the user reinstalls Windows (over and over and over), this internet key becomes worthless. I don’t know why this happens exactly, but it’s obvious that the new installation doesn’t assign the same function to the key.

Using the kickass program, Autohotkey, we can restore its browser-launching capabilities.

1. Install Autohotkey. If you haven’t already, you’re an idiot. Just kidding. go http://www.autohotkey.com and get it done.

2. Create and save a new script. (If you’re a noob, start here)

3. Follow these directions from their help file, with the subheading “List of Keys, Mouse Buttons, and Joystick Controls”:

If your keyboard or mouse has a key not listed above, you might still be able to make it a hotkey by using the following steps (requires Windows XP/2000/NT or later):

Ensure that at least one script is running that is using the keyboard hook. You can tell if a script has the keyboard hook by opening its main window and selecting “View->Key history” from the menu bar.
Double-click that script’s tray icon to open its main window.
Press one of the “mystery keys” on your keyboard.
Select the menu item “View->Key history”
Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE: Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access. For possible solutions, see further below.
If your key is detectible, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159).
To define this key as a hotkey, follow this example:
SC159:: ; Replace 159 with your key’s value.
MsgBox, %A_ThisHotKey% was pressed.
return

Ok, once you’ve done all that,you can now write a script to launch a browser. You can use mine:

SC101::
Run C:\Program Files\Mozilla Firefox\firefox.exe
WinWait, My Yahoo!,
IfWinNotActive, My Yahoo!, , WinActivate, My Yahoo!
WinWaitActive, My Yahoo!,
WinMaximize, My Yahoo!
Return

SC101 is the name of my Dell Inspiron 5150′s internet key–the name of your key might be different. The above script starts Firefox and activates it for me. One button press, baby, one press.

Of course, you should have all sorts of combos going in Autohotkey, but this is a good start. If you put in some time on the front end with Autohotkey’s learning curve, it will pay big dividends in the end.

Peace out, Napoleon.

-MC Spanky McGee

This entry was posted in Tech and tagged , , , by MC_Spanky_ McGee. Bookmark the permalink.

About MC_Spanky_ McGee

Spanky really likes Wendy's #6, and does not buy the so-called purist's prohibition against adding onions or pepperjack to Spicy Chicken. Spanks also rocks out El Burrito Loco in DeKalb, IL. Winners: Arby's, Taco Bell, and Burger King. Losers: Taco John's and people who don't cuss. Slappy is a firm believer in evolution, loves his iPod, and does not like the Republican Party. Slappy also likes double-bass-driven metal (Tool, Lamb of God, etc), funk, classic rock, but also likes classical and pop music.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>