[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 780
  • Last Modified:

Emulate keyboard key click with JavaScript

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
pdben
Asked:
pdben
  • 2
1 Solution
 
dgelinasCommented:
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
 
GwynforWebCommented:
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
 
pdbenAuthor Commented:
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
 
pdbenAuthor Commented:
I will accept dgelinas
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now