Archive for the ‘mouse’ Category

Easy Resize Script: Fix

Posted: February 4, 2011 by jellymann in computers, fixes, hotkeys, keyboard, mouse, windows

I forgot something on my last post. The Easy Window Resize script I showed you had the same labels as the original Easy Window Move, so it didn’t work unless you ran them on separate scripts. The simple fix is to rename all the labels to unique ones. Otherwise, you can just use the fixed one below. I replaced all “EWD” with “EWR” and changed all “LButton” to “MButton”.

#MButton::
CoordMode, Mouse ; Switch to screen/absolute coordinates.
MouseGetPos, EWR_MouseStartX, EWR_MouseStartY, EWR_MouseWin
WinGetPos, EWR_OriginalPosX, EWR_OriginalPosY,,, ahk_id %EWR_MouseWin%
WinGet, EWR_WinState, MinMax, ahk_id %EWR_MouseWin%
if EWR_WinState = 0 ; Only if the window isn't maximized
SetTimer, EWR_WatchMouse, 10 ; Track the mouse as the user drags it.
return

EWR_WatchMouse:
GetKeyState, EWR_MButtonState, MButton, P
if EWR_MButtonState = U ; Button has been released, so drag is complete.
{
SetTimer, EWR_WatchMouse, off
return
}
GetKeyState, EWR_EscapeState, Escape, P
if EWR_EscapeState = D ; Escape has been pressed, so drag is cancelled.
{
SetTimer, EWR_WatchMouse, off
WinMove, ahk_id %EWR_MouseWin%,, %EWR_OriginalPosX%, %EWR_OriginalPosY%
return
}
; Otherwise, reposition the window to match the change in mouse coordinates
; caused by the user having dragged the mouse:
CoordMode, Mouse
MouseGetPos, EWR_MouseX, EWR_MouseY
WinGetPos, EWR_WinX, EWR_WinY, EWR_WinW, EWR_WinH, ahk_id %EWR_MouseWin%
SetWinDelay, -1 ; Makes the below move faster/smoother.
if (EWR_MouseX-EWR_WinX) <= (EWR_WinW/3)
{
if (EWR_MouseY-EWR_WinY) <= (EWR_WinH/3)
{
WinMove, ahk_id %EWR_MouseWin%,, EWR_WinX + EWR_MouseX - EWR_MouseStartX, EWR_WinY + EWR_MouseY - EWR_MouseStartY, EWR_WinW + EWR_MouseStartX - EWR_MouseX, EWR_WinH + EWR_MouseStartY - EWR_MouseY
}
else if (EWR_MouseY-EWR_WinY) <= (EWR_WinH/3)*2
{
WinMove, ahk_id %EWR_MouseWin%,, EWR_WinX + EWR_MouseX - EWR_MouseStartX, , EWR_WinW + EWR_MouseStartX - EWR_MouseX,
}
else
{
WinMove, ahk_id %EWR_MouseWin%,, EWR_WinX + EWR_MouseX - EWR_MouseStartX, , EWR_WinW + EWR_MouseStartX - EWR_MouseX, EWR_WinH + EWR_MouseY - EWR_MouseStartY
}
}
else if (EWR_MouseX-EWR_WinX) <= (EWR_WinW/3)*2
{
if (EWR_MouseY-EWR_WinY) <= (EWR_WinH/2)
{
WinMove, ahk_id %EWR_MouseWin%,,, EWR_WinY + EWR_MouseY - EWR_MouseStartY,, EWR_WinH + EWR_MouseStartY - EWR_MouseY
}
else
{
WinMove, ahk_id %EWR_MouseWin%,,,,, EWR_WinH + EWR_MouseY - EWR_MouseStartY
}
}
else
{
if (EWR_MouseY-EWR_WinY) <= (EWR_WinH/3)
{
WinMove, ahk_id %EWR_MouseWin%,,, EWR_WinY + EWR_MouseY - EWR_MouseStartY, EWR_WinW + EWR_MouseX - EWR_MouseStartX, EWR_WinH + EWR_MouseStartY - EWR_MouseY
}
else if (EWR_MouseY-EWR_WinY) <= (EWR_WinH/3)*2
{
WinMove, ahk_id %EWR_MouseWin%,,, , EWR_WinW + EWR_MouseX - EWR_MouseStartX,
}
else
{
WinMove, ahk_id %EWR_MouseWin%,,, , EWR_WinW + EWR_MouseX - EWR_MouseStartX, EWR_WinH + EWR_MouseY - EWR_MouseStartY
}
}
EWR_MouseStartX := EWR_MouseX ; Update for the next timer-call to this subroutine.
EWR_MouseStartY := EWR_MouseY
return

Easy Window Moving and Resizing

Posted: January 29, 2011 by jellymann in computers, hotkeys, keyboard, mouse, windows

Normally, a window can only be dragged by clicking on its title bar. This script extends that so that any point inside a window can be dragged while holding down a modifier, in this case the Windows key. This is a slightly modified version of this script, and I mentioned it in one of my previous AutoHotkey posts.

#LButton::
CoordMode, Mouse ; Switch to screen/absolute coordinates.
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin
WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, ahk_id %EWD_MouseWin%
WinGet, EWD_WinState, MinMax, ahk_id %EWD_MouseWin%
if EWD_WinState = 0 ; Only if the window isn't maximized
SetTimer, EWD_WatchMouse, 10 ; Track the mouse as the user drags it.
return

EWD_WatchMouse:
GetKeyState, EWD_LButtonState, LButton, P
if EWD_LButtonState = U ; Button has been released, so drag is complete.
{
SetTimer, EWD_WatchMouse, off
return
}
GetKeyState, EWD_EscapeState, Escape, P
if EWD_EscapeState = D ; Escape has been pressed, so drag is cancelled.
{
SetTimer, EWD_WatchMouse, off
WinMove, ahk_id %EWD_MouseWin%,, %EWD_OriginalPosX%, %EWD_OriginalPosY%
return
}
; Otherwise, reposition the window to match the change in mouse coordinates
; caused by the user having dragged the mouse:
CoordMode, Mouse
MouseGetPos, EWD_MouseX, EWD_MouseY
WinGetPos, EWD_WinX, EWD_WinY,,, ahk_id %EWD_MouseWin%
SetWinDelay, -1 ; Makes the below move faster/smoother.
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY
EWD_MouseStartX := EWD_MouseX ; Update for the next timer-call to this subroutine.
EWD_MouseStartY := EWD_MouseY
return

Gnome windows can also be resized using a modifier+middle mouse button. So to have that functionality in windows, I tweaked the above script a little bit. First, since I’m not very familiar with AHK, I studied the script for a few minutes to find out where all the action lies. I discovered the line that does the actual moving based on all the information collected from user input, etc:

WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY

This means: Move the window (WinMove) that’s under the mouse (ahk_id %EWD_MouseWin%) to position (X,Y), which is the original position of the window (EWD_WinX,EWD_WinY) plus the distance moved by the mouse, which is the position of the mouse (EWD_MouseX,EWD_MouseY) subtracted by the position of the mouse before it was moved (EWD_MouseStartX,EWD_MouseStartY).

Now all I had to do was replace that code with new code that resizes the window instead of moving it. The WinMove function above is taking three arguments, the window to be moved, X and Y. To resize a window, all one has to do is add width and height at the end of the function, so it would be something like this:

WinMove, window, x, y, width, height

The tricky thing about resizing is that the window must resize in a different direction depending on what region of the window the mouse is in. The following image shows where these regions are:

Basically, the window is cut into thirds vertically, then the two side regions are cut into thirds again horizontally, and the center is cut in half horizontally. I used a bunch of nested if-statements to check which region the mouse cursor is and then move/resize the window accordingly. I’m not sure if it is the best way, but it works. Here is that part of the script:

if (EWD_MouseX-EWD_WinX) <= (EWD_WinW/3)
{
if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)
{
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY, EWD_WinW + EWD_MouseStartX - EWD_MouseX, EWD_WinH + EWD_MouseStartY - EWD_MouseY
}
else if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)*2
{
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, , EWD_WinW + EWD_MouseStartX - EWD_MouseX,
}
else
{
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, , EWD_WinW + EWD_MouseStartX - EWD_MouseX, EWD_WinH + EWD_MouseY - EWD_MouseStartY
}
}
else if (EWD_MouseX-EWD_WinX) <= (EWD_WinW/3)*2
{
if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/2)
{
WinMove, ahk_id %EWD_MouseWin%,,, EWD_WinY + EWD_MouseY - EWD_MouseStartY,, EWD_WinH + EWD_MouseStartY - EWD_MouseY
}
else
{
WinMove, ahk_id %EWD_MouseWin%,,,,, EWD_WinH + EWD_MouseY - EWD_MouseStartY
}
}
else
{
if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)
{
WinMove, ahk_id %EWD_MouseWin%,,, EWD_WinY + EWD_MouseY - EWD_MouseStartY, EWD_WinW + EWD_MouseX - EWD_MouseStartX, EWD_WinH + EWD_MouseStartY - EWD_MouseY
}
else if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)*2
{
WinMove, ahk_id %EWD_MouseWin%,,, , EWD_WinW + EWD_MouseX - EWD_MouseStartX,
}
else
{
WinMove, ahk_id %EWD_MouseWin%,,, , EWD_WinW + EWD_MouseX - EWD_MouseStartX, EWD_WinH + EWD_MouseY - EWD_MouseStartY
}
}

The second thing I changed what what mouse button to use. There are two places where this has to change:

The first line #LButton:: must be changed to #MButton:: to use the middle button for resizing.

Then, a few lines down, after EWD_WatchMouse:, there is the line which checks if the mouse button is down: GetKeyState, EWD_LButtonState, LButton, P. All we do is change LButton to MButton, so it looks like this: GetKeyState, EWD_LButtonState, MButton, P. I didn’t bother with changing EWD_LButtonState because that’s just a variable name, and when I did try change it, and all other instances of it, the script stopped working, so I just left it.

And here is the finished script:
[UPDATE] This script doesn’t work with the Easy Window Move script unless it is separate. My next post has a simple fix for that.

#MButton::
CoordMode, Mouse ; Switch to screen/absolute coordinates.
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin
WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, ahk_id %EWD_MouseWin%
WinGet, EWD_WinState, MinMax, ahk_id %EWD_MouseWin%
if EWD_WinState = 0 ; Only if the window isn't maximized
SetTimer, EWD_WatchMouse, 10 ; Track the mouse as the user drags it.
return

EWD_WatchMouse:
GetKeyState, EWD_LButtonState, MButton, P
if EWD_LButtonState = U ; Button has been released, so drag is complete.
{
SetTimer, EWD_WatchMouse, off
return
}
GetKeyState, EWD_EscapeState, Escape, P
if EWD_EscapeState = D ; Escape has been pressed, so drag is cancelled.
{
SetTimer, EWD_WatchMouse, off
WinMove, ahk_id %EWD_MouseWin%,, %EWD_OriginalPosX%, %EWD_OriginalPosY%
return
}
; Otherwise, reposition the window to match the change in mouse coordinates
; caused by the user having dragged the mouse:
CoordMode, Mouse
MouseGetPos, EWD_MouseX, EWD_MouseY
WinGetPos, EWD_WinX, EWD_WinY, EWD_WinW, EWD_WinH, ahk_id %EWD_MouseWin%
SetWinDelay, -1 ; Makes the below move faster/smoother.
if (EWD_MouseX-EWD_WinX) <= (EWD_WinW/3)
{
if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)
{
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY, EWD_WinW + EWD_MouseStartX - EWD_MouseX, EWD_WinH + EWD_MouseStartY - EWD_MouseY
}
else if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)*2
{
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, , EWD_WinW + EWD_MouseStartX - EWD_MouseX,
}
else
{
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, , EWD_WinW + EWD_MouseStartX - EWD_MouseX, EWD_WinH + EWD_MouseY - EWD_MouseStartY
}
}
else if (EWD_MouseX-EWD_WinX) <= (EWD_WinW/3)*2
{
if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/2)
{
WinMove, ahk_id %EWD_MouseWin%,,, EWD_WinY + EWD_MouseY - EWD_MouseStartY,, EWD_WinH + EWD_MouseStartY - EWD_MouseY
}
else
{
WinMove, ahk_id %EWD_MouseWin%,,,,, EWD_WinH + EWD_MouseY - EWD_MouseStartY
}
}
else
{
if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)
{
WinMove, ahk_id %EWD_MouseWin%,,, EWD_WinY + EWD_MouseY - EWD_MouseStartY, EWD_WinW + EWD_MouseX - EWD_MouseStartX, EWD_WinH + EWD_MouseStartY - EWD_MouseY
}
else if (EWD_MouseY-EWD_WinY) <= (EWD_WinH/3)*2
{
WinMove, ahk_id %EWD_MouseWin%,,, , EWD_WinW + EWD_MouseX - EWD_MouseStartX,
}
else
{
WinMove, ahk_id %EWD_MouseWin%,,, , EWD_WinW + EWD_MouseX - EWD_MouseStartX, EWD_WinH + EWD_MouseY - EWD_MouseStartY
}
}
EWD_MouseStartX := EWD_MouseX ; Update for the next timer-call to this subroutine.
EWD_MouseStartY := EWD_MouseY
return

AutoHotkey puts the HOT in Hotkey

Posted: November 25, 2010 by jellymann in computers, hotkeys, keyboard, mouse, tech, windows

If you’re a Windows user and you don’t know about AutoHotkey, you’re living a sad, sad life.

AutoHotkey unleashes the full potential of your keyboard, joystick, and mouse. For example, in addition to the typical Control, Alt, and Shift modifiers, you can use the Windows key and the Capslock key as modifiers. In fact, you can make any key or mouse button act as a modifier.”

AutoHotkey (AHK) works with scripts. The basic syntax is fairly easy to understand, however some of the more complicated stuff is, well, more complicated.

Lets look at an example of a simple but very useful AHK script; a hotkey that runs a program, eg. Calculator, when WindowsKey and C is pressed:

#c:: Run, calc

The hash (#) represents the Windows Key. The letter after that is the key to be pressed with the Windows Key. Thus ‘#c‘ means the hotkey is activated when the WindowsKey and C is pressed. Other modifiers include Shift, represented by a plus sign (+), Control by a caret (^) and Alt by an exclamation mark (!).

Then there’s two colons (::) directly after defining the keys. Whatever is on the right of the colons is what is executed when the keys are pressed.

Run‘ quite simply runs the command after the comma, and ‘calc‘ is the command in Windows for opening the Calculator. You can do the same thing with ‘notepad‘, ‘cmd‘, ‘iexplore‘, and loads more.

Scripts can obviously be more than one line long, for example:

#c::
Sleep 10
Run, calc
return

Does basically the same thing, except for the ‘Sleep‘ command, which, in this case, waits ten milliseconds before running ‘calc‘.

The ‘return‘ function ends the multi-line hotkey. If you didn’t have this here and you define another hotkey after that one, it might think that hotkey is part of the previous one.

Besides built-in Windows programs like ‘calc‘ and ‘notepad‘, other programs can be ‘Run’. For example, I use Notepad++ and use Windows Key and N to launch it using the following script:

#n::
Sleep 10
Run, E:\programs\npp\notepad++.exe
return

You can even ‘Run‘ websites. For example, you could make Windows Key and F open Facebook in your default browser:

#f::
Sleep 10
Run, http://www.facebook.com
return

I have a very useful hotkey that Googles whatever I select by pressing Windows Key and G:

#g::
Send, ^c
Sleep 50
Run, http://www.google.com/search?q=%clipboard%
return

The ‘Send‘ command here “sends” Control+C to the computer as though you pressed it on the keyboard. This copies whatever text you might have selected into the clipboard.

After sleeping for fifty milliseconds (to make sure the computer is finished copying your selection) it runs Google with the copied text as the search criteria.

%clipboard%’ puts whatever is copied into the clipboard wherever you want. You can even put it in a ‘Send’ command (i.e. Send, %clipboard%)

Scripts can get very complicated, for instance, this script I have which allows me to move my Windows around without dragging from the titlebar by holding down the Windows Key (like Gnome/Ubuntu):

#LButton::
CoordMode, Mouse ; Switch to screen/absolute coordinates.
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin
WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, ahk_id %EWD_MouseWin%
WinGet, EWD_WinState, MinMax, ahk_id %EWD_MouseWin%
if EWD_WinState = 0 ; Only if the window isn’t maximized
SetTimer, EWD_WatchMouse, 10 ; Track the mouse as the user drags it.
return

EWD_WatchMouse:
GetKeyState, EWD_LButtonState, LButton, P
if EWD_LButtonState = U ; Button has been released, so drag is complete.
{
SetTimer, EWD_WatchMouse, off
return
}
GetKeyState, EWD_EscapeState, Escape, P
if EWD_EscapeState = D ; Escape has been pressed, so drag is cancelled.
{
SetTimer, EWD_WatchMouse, off
WinMove, ahk_id %EWD_MouseWin%,, %EWD_OriginalPosX%, %EWD_OriginalPosY%
return
}
; Otherwise, reposition the window to match the change in mouse coordinates
; caused by the user having dragged the mouse:
CoordMode, Mouse
MouseGetPos, EWD_MouseX, EWD_MouseY
WinGetPos, EWD_WinX, EWD_WinY,,, ahk_id %EWD_MouseWin%
SetWinDelay, -1 ; Makes the below move faster/smoother.
WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX – EWD_MouseStartX, EWD_WinY + EWD_MouseY – EWD_MouseStartY
EWD_MouseStartX := EWD_MouseX ; Update for the next timer-call to this subroutine.
EWD_MouseStartY := EWD_MouseY
return

Don’t ask me to explain this, I got it from somewhere else. By the way, anything after a semi-colon (;) is a comment and is ignored by AHK.

Here are a few more that I use:

Windows Key and H toggles Show/Hide Hidden Files in Explorer:

#h::
RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
If HiddenFiles_Status = 2
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
Else
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2
WinGetClass, eh_Class,A
If (eh_Class = “#32770” OR A_OSVersion = “WIN_VISTA”)
send, {F5}
Else PostMessage, 0x111, 28931,,, A
Return

Windows Key and Right Mouse Button (Yes you can combine with mouse events!) minimizes the Window under the mouse cursor:

#RButton::
MouseGetPos, , , WinID, control
WinGetPos, WinX, WinY, WinWidth, , ahk_id %WinID%
WinMinimize, ahk_id %WinID%
return

Windows Key and Q is a lot more comfortable than Alt F4, which is a commonly used hotkey for me. This simple one-liner saves me some wrist aerobics:

#Q::WinClose,A

Check out the Tutorial on AHK scripting, the list of keys, or the list of commands that you can use.

I hope you find these scripts useful. Also, I’d love to see what scripts you guys are using, too.

Special thanks to @EttVenter for telling me about the awesomeness of AutoHotkey, and @brskln, who’s recent tweets inspired this blog post.

Read my other post for a few more scripts to make your life easier.

Look mom, no mouse!

Posted: October 13, 2010 by jellymann in computers, keyboard, mouse, tech

Using a computer with no mouse isn’t as hard as you think… if you think it’s hard. Pretty much every program has shortcut keys, as well as windows itself, and they pretty much do everything. Obviously you lose a few features like being able to draw stuff and play certain games.

Here’s the thing: Using the mouse requires you to move it, and the bigger your screen, the more you have to move it to get to places. Think of those massive 30″ Apple HD Cinema Displays, the distance between the menu bar and the dock is outrageous. The cursor has to pack a suitcase and padkos before it goes on it’s vacation to South Desktop.

The keyboard, however, has not changed its basic size since it’s conception due to the fact that the human hand has retained its overall dimensions. Moving your hand across the keyboard to reach a certain key can take split-seconds.

Some of the first keyboard shortcuts were introduced by Apple, of course because they are like the king of user interfaces. Here are some of the most used Command (or Apple) Key shortcuts:

+Q quits the current program (like totally quits it)
+W closes the current window (doesn’t quit the program, though)
+T opens a new tab in Safari, Firefox, Chrome.
+Space opens a quick search with spotlight.
Shift+Command searches through menu items.
+Z undoes what you just did (resembles the action of striking out a mistake)
(+X cuts the currently selected text/item (resembles a scissors) basically like copying and then deleting the original) This has been removed from Mac OS?
+C copies the currently selected text or item
+V pastes the currently copied or cut text or item (resembles an arrow pointing downward “into” the document/folder/whatever)

Although some of the letters have some sort of “meaning”, isn’t it oddly coincidental that all of these keys are in one continuous line right next to the Command button? meh… Maybe the guy who invented the QWERTY Keyboard knew about this.

Windows computers have their not-so-all-powerful Windows Key (or WINKEY, which is a pretty bad name depending on how you read it). Now that I think about it, the Windows Key is probably the least used function key on the keyboard, for the average computer use that is. Here are some of them.

Just pressing the Windows Key by itself it opens the start menu
+D shows the desktop, press it again to bring all your windows back.
+M minimizes all windows.
+Shift+M unminimizes all the windows you minimized with the previous shortcut.
+R opens the run dialog.
+E opens an explorer window at “My Computer”.
+F opens a search window.
+Tab cycles between taskbar items.
+Shift+Tab .smeti rabksat neewteb selcyc
+L locks the computer.
+U opens the utility manager, for stuff like the magnifier, Microsoft Sam’s annoying text-to-speech and the the on-screen keyboard.
+Pause opens System Properties.
Windows 7 added a bunch more:
+1…9 opens or activates the first nine programs on the “Superbar”.
+G cycles through desktop widgets.
+Arrow Keys manipulates the size and position of the active window. Play around with it, you’ll get the idea.
+Home minimizes all but the active window.
+Space makes all the windows transparent (like mousing over the “show desktop” button).
+Tab doesn’t do the same as XP, but rather activates that silly Aero Flip or whatever it’s called.
+T does what WIN+Tab does in XP.
+B switches focus to the system tray.
+Plus zooms in
+Minus zooms out

Not to mention all the useful shortcut keys that don’t use the Windows Key:

Alt+F4 is everyone’s favourite, isn’t it? Easy to use, it has one basic function: Quit! It also brings up the Shut-down dialog when no window is in focus (like when you’ve quit all your programs with it already! Muahahahaha!!)
Ctrl+Esc opens the start menu. I only ever used this on an old IBM laptop which didn’t have a Windows Key, which is very frustrating since I rely on so many Win+ shortcuts…
Alt+Tab switches between windows. In Windows 7 and some Linux distros, all other windows except the one selected will be visible during the switch.
Alt+Shift+Tab .swodniw neewteb sehctiws. You get the idea?
Alt+Enter does different things depending on the program. In explorer and Internet Explorer, it displays the properties of the selected file or webpage respectivly. In most games it toggles full-screen/windowed mode (e.g. Far Cry 2, DOSBox, etc.)
Ctrl+T opens a new tab in Internet Explorer, Firefox, Chrome, Safari, Opera, etc…
Alt+Space is like right-clicking on the title-bar.
F1 for help.
F2 renames selected file.
F3 for finding stuff, like words in documents and webages. Also “Find Next” while you are finding something.
F4 activates the menu bar of a window. Windows Explorer, Internet Explorer and a few other programs have the menu hidden, F4 shows hidden menu bars. The Alt by itself also shows hidden menu bars while activating them.
F5 reloads/refreshes the page.
F8 opens Windows boot options (like Safe Mode, etc) when pressed during Windows boot.
F11 makes Windows Explorer, Internet Explorer, Firefox, and other web browsers full screen, otherwise known as ‘Kiosk’ mode.

And don’t forget that little key which opens the right-click menu. I find it very useful sometimes.

There are still hundreds more useful (and useless) shortcuts out there. Most are for specific programs (like the “F” keys in Corel Draw)

However, you are by no means limited to these shortcuts alone. There is an amazing utility called Autohotkey which allows you to create your own shortcuts for literally anything on your computer. It goes beyond keyboard shortcuts, as it also has features for the mouse and joysticks.

Let me know if there are any common, useful shortcuts I missed out. I have a feeling I’ve missed at least one very important one. lol

I would post some of my Autohotkey scripts, but my computer with all of them is broken. I promise to post all of them when it’s up and running again.