Solved

Emulate keyboard key click with JavaScript

Posted on 2004-03-29
5
751 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

895 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

13 Experts available now in Live!

Get 1:1 Help Now