/    Sign up×
Community /Pin to ProfileBookmark

triggering keyboard input within the whole document

I am having trouble building an event handler that is will be invoked any time some one presses a particualr key. i know the correct key codes but I am pretty lost as to how to do it. I can’t find examples that clearly illustrate what i am to do. I am using ie 6.0. I want to make it so a javascript function is triggered when a user inputs the letter 0 anytime while browsing the document. this may sounds silly to some but I am pretty lost on how this works.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@angrytunaMar 28.2003 — Try [URL=http://developer.irt.org/script/event.htm]this[/URL][irt.org]. In particular, look for FAQ 848

~at
Copy linkTweet thisAlerts:
@webrunnerauthorMar 28.2003 — thanks It worked, I knew it was something that I may have missed. I feel kind of bad, Thanks for the help though.
Copy linkTweet thisAlerts:
@webrunnerauthorMar 29.2003 — Just out of curiousity anybody know the codes for capturing the function keys like F2. I know some of them are in use, but it might help me to use function keys. I am looking on the web but so far no dice. I set up window.event.keyCode and have it write out the results when I press the F2 key but I don't get any key code.
Copy linkTweet thisAlerts:
@webrunnerauthorMar 29.2003 — This is frustrating I have a scan codes for example F2 is 113 and it just won't work on onKeyPress in the body tag. If anyone could help me it would be appreciated.
Copy linkTweet thisAlerts:
@nutcrackerJan 05.2007 — I'm having a similar problem. I need keycodes for the down arrow key. I have a matrix of text boxes and I want the cursor to move vertically downwards when I press the down arrow key. Please help.

Thanks,

Tony.
×

Success!

Help @webrunner spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...