Solved

Emulate keyboard key click with JavaScript

Posted on 2004-03-29
5
749 Views
Last Modified: 2012-06-21
Does anyone know how to emulate a keyboard key click?  For example, by pressing a link, can I bring up the Internet Explorer Find dialog box in the same way that pressing Ctrl+f on my keyboard brings up the Find dialog box?
0
Comment
Question by:pdben
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
dgelinas earned 125 total points
ID: 10708020
Can't do that.  You can capture the ctrl+f but you cannot bring up the dialog box, or any of the other features that you might be thinking of.  You can work to duplicate what that window does though.  

For example:
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20931835.html
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 10708205
key events can not be emulated for security reasons other wise you could take over the users machine. To sinmulate ctrl-f use the code I posted in the above link.
0
 

Author Comment

by:pdben
ID: 10708448
Another similar keyboard action I would like to emulate is the Undo (ctrl+u) and Redo (ctrl+y) functions in Internet Explorer objects which support variable text.  I would like to do this with execCommand(), but I don't think it supports it currently.  Is there any other way to do utilize Undo and Redo other than prompting a user to use their keyboard?
0
 

Author Comment

by:pdben
ID: 11077221
I will accept dgelinas
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now