Tag Archives: keyboard

How to Detect an ESC key press using jQuery? CodeUnit 07 AUG 2012

As per usual, the always brilliant jQuery javascript library makes it particularly easy to detect and act on a keyboard button press action. For this particular snippet we are interesting in binding our function to the user hitting the Escape (ESC) on their keyboard.

To achieve this, we make use of jQuery’s keyup listener method and bind it to the document itself. Then making use of the useful keyCode parameter passed in by the browser, we simply check for the code associated with the ESC key and act.

In practice:

$(document).keyup(function(e) {
if (e.keyCode == 27) { 
   alert('Esc key pressed!');
}
});

Simple and effective.

Keyboard Shortcut: How to Zoom in and out on a Web Page CodeUnit 15 JUL 2011

The ability to zoom in and out on web pages has actually been around for a while now, and is particularly useful on small screen devices like phones and tablets. Of course, it is of limited use on a big desktop monitor, but nevertheless, the ability is actually there – particularly useful if you have poor eyesight or really want to see that girl’s thighs up close.

A quick way to zoom in and out of a web page is to make use of the pretty standard keyboard shortcut adopted by most browsers, namely Control + or Control -.

Hitting the first combination of the control and plus keys zooms in on a page, while a control and a minus zooms out.

And now you know.

Windows Keyboard Shortcut: Quick, Launch the Task Manager! CodeUnit 11 JUL 2011

Here’s a nifty Windows keyboard shortcut which I was not aware of until recently. My version of Vista tends to freeze a lot, meaning a lot of sluggish trips through to the Open Task Manager button on the Control+Alt+Delete screen. However, with this particular keyboard shortcut, you can launch Task Manager directly, which is pretty awesome if your machine is about to keel over and you don’t want the poor thing struggling to draw new and unnecessary windows!

To launch, simply press Control+Shift+Escape, which will quick launch task manager in the blink of an eye.

Nifty!

Shortcut Keys for Tabbed Browsing CodeUnit 05 FEB 2010

You seriously learn something new every day. I only just found out about keyboard shortcuts to enhance tabbed browsing, something that has been a feature in Firefox (and more recently Internet Explorer) for years already.

And because I fear that there may still be people like me outside there in this great big world of ours, I thought I’d better share these keyboard shortcuts that work across most tabbed browsers with you!

So let’s start then.

In order to open a link in a new tab and jump straight to it, hold down CTRL+SHIFT and click on the link. In order to open it up in a new tab but NOT jump straight to it, simply hold down CTRL and click on the link. CTRL+T will simply open a new empty tab and jump you straight to it.

To jump to the next open tab in your tabbed browser, simply press CTRL+TAB. To reverse through your open tabs, use CTRL+SHIFT+TAB.

CTRL+W will close the tab you are currently focused on.

If you want to jump to a specific tab and you have 8 tabs open, pressing CTRL+n where n is a number between 1 and 8 will jump you directly to that particular tab based on the order in which it currently sits. CTRL+9 generally takes you to the last open tab.

And finally, in Internet Explorer, pressing CTRL+ALT+F4 will close all tabs except for the one you are currently viewing. Also, and probably the coolest of the lot, CTRL+Q opens up a new tab which lists all your currently open tabs with a thumbnail, similar to the way Chrome displays its blank tabs.

So now you know! ;)