Solved

Emulate keyboard key click with JavaScript

Posted on 2004-03-29
5
758 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Triple line in an alert message 4 24
Table doesn't show the lines! 3 24
Put POST values into cookies. 14 34
Add - in a loop to first and last element. 6 42
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

726 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