skip to main
|
skip to sidebar
Andrew's Blog
Sunday, August 8, 2010
Get event keycode in both Firefox and Internet Explorer
This solution should work in both IE and Firefox.
JS -
function getCharCode(event)
{
var charCode = (event.which) ? event.which : event.keyCode
;
// Might want to get the character representation of the Unicode keycode -
var character = String.fromCharCode(keycode);
}
HTML -
Just put an onkeypress="getCharCode(event)" event handeler in your input code (textarea, whatever)
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)
Blog Archive
►
2011
(1)
►
May
(1)
Add an element before the last element of it's kin...
▼
2010
(8)
▼
August
(1)
Get event keycode in both Firefox and Internet Exp...
►
July
(1)
Open files in a folder recursively with Notepad++
►
June
(1)
Installing Canon MF3240 on Windows 7 64 bit (x64)
►
April
(1)
7-zip not in context menu 64-bit Windows 7
►
March
(2)
MagpieRSS question marks
Concatenate Date and Time From Two Fields -- MySQL...
►
January
(2)
Change essays, application after submission of Com...
Bottled water - wasteful, expensive, and unsanitar...
►
2009
(11)
►
September
(2)
Liberal Misrepresentation of the Tea Party events ...
Internet Sharing fix for Sprint HTC devices (HTC S...
►
August
(5)
PHP - Get a list of a particular day of the week b...
PHP - Get a range of dates between two dates
PHP - Serialize an array for use in a MySQL table
PHP - Format a variable for a MySQL query
PHP - Find min and max values in an array
►
April
(1)
Why the Swine Flu is more dangerous than the regul...
►
March
(1)
Creating Samba shares with no username or password...
►
January
(2)
News Summary: Israel tells Gazans to brace for war...
How to recover most/all of your JournalSpace posts...
►
2008
(5)
►
December
(1)
Blank screen on startup after installing Ubuntu 8....
►
August
(2)
Download a YouTube video using C#
Visual C# 2008 Express Edition Setup Error - Setup...
►
July
(1)
Fixing rdp MIME type in Ubuntu Linux
►
April
(1)
Ubuntu 8.04 Notes and Tips I currently run Ubuntu ...
►
2007
(6)
►
June
(2)
O' Reilly cuts off Swanson... my thoughts
Defining a human
►
May
(1)
Understanding p2p
►
April
(2)
acroread expr syntax error (Adobe Reader for Linux...
Back to Linux
►
February
(1)
XP versus Linux... why I chose Windows XP
►
2006
(3)
►
December
(3)
Poor ps3 sales - Completely Owned?
Ben Stein quote
What to do?
About Me
Name: Andrew S.
I am a complete nerd. I love computers and everything to do with them. When I'm not procrastinating, I'm either browsing the web or installing Linux.
View my complete profile