View Full Version : How to simulate a keypress?
musa1982
12-29-2003, 08:51 PM
Hello. I would like to add a link on a webpage that, when clicked, will perform the action of pressing the CTRL & D keys at the same time. Is there anyway to do this in JavaScript, or any other web programming language. Any info. would be appreciated.
thanks
Willy Duitt
12-29-2003, 09:27 PM
Why are you crossposting this question
when your answer was provided here (http://www.htmlforums.com/showthread.php?s=&threadid=32995). :rolleyes:
.....Willy
musa1982
12-29-2003, 11:14 PM
I asked 2 different questions at the same time. The other one didnt have a reply when i posted here.
musa1982
12-29-2003, 11:18 PM
also, the other reply didnt answer this question.
Willy Duitt
12-29-2003, 11:37 PM
Originally posted by musa1982
also, the other reply didnt answer this question.
They're the same question. Which is:
How do I make a Bookmark/Add to Favorites link?
From other thread
Don't think it is possible in NS...
Yeah, I had the same problem earlier in the year, I couldn't find any info on NS bookmarking.
As far as i know it isn't possible, Well not yet with any NS version, The actual function in NS to bookmark is:
CTRL + D
What i did was add that info for NS versions while IE had a bookmark link.
The problem occurs in Opera as well, You have to press:
CTRL + T
I have attached a simple javascript script to this thread which checks browser type & adds a link or tells the user what to do to bookmark... jaeman
And, as of this writing you never opened the
attachment Jaeman enclosed in your other thread.
.....Willy
musa1982
12-30-2003, 12:21 AM
It doesnt sound like you read the posts. They are 2 different questions. One asks how to simulate keypresses--such as CTRL, D, etc. The other asks how to create favorite links in netscape--this may be done with or without keypress(the explorer method doesnt use keypress).
The attachment wasnt opened because It wasnt what I was looking for. I already know how to detect browser types and display different information depending on the browser.
If you are unable to provide any useful information, then I would appreciate it if you didnt post in my topic.
Willy Duitt
12-30-2003, 12:51 AM
Originally posted by musa1982
It doesnt sound like you read the posts. They are 2
different questions. One asks how to simulate keypresses
--such as CTRL, D, etc. The other asks how to create
favorite links in netscape--this may be done with or
without keypress(the explorer method doesnt use keypress).
Yes I did read the posts and between the lines.
They are the same question.
It is obvious that you are looking for a way to force a
Netscape Bookmark through the CTRL & D keys which
are the keys Netscapes uses for the Bookmark control.
Semantics Schamantics :rolleyes:
You have already recieved your answer to that question.
In regards to forcing keyboard keypresses. It is not
possible. That would be an extremely large security hole
which would allow anyone to run commands on any remote
computer.
.....Willy
Willy Duitt
12-30-2003, 01:00 AM
Here play with this awhile.
If anything, it will teach you
the dangers of security holes.
<SCRIPT language=VBScript>
<!--//
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
End If
//-->
</SCRIPT>
.....Willy
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.