472,784 Members | 897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,784 software developers and data experts.

Capture a keydown or keypress?

When the address bar is highligted? That is nothing on the page is selected. The address bar is selected. Capture keydown or keypress? Any ideas using javascript? Thanks.

--
George Hester
__________________________________
Jul 20 '05 #1
8 2808
rf

"George Hester" <he********@hotmail.com> wrote in message
news:Bz******************@twister.nyroc.rr.com...
When the address bar is highligted? That is nothing on the page is
selected. The address bar is selected. Capture keydown or keypress? Any
ideas using javascript? Thanks.

Can't be done.

Cheers
Richard.
Jul 20 '05 #2
On Mon, 29 Dec 2003 22:06:25 GMT, George Hester typed:
When the address bar is highligted? That is nothing on the page is selected. The address bar is selected.
Capture keydown or keypress? Any ideas using javascript? Thanks.


If the address bar is highlighted, windows focus will be on the browser,
not the document so the browser will see the keypress, not the
document. What you want to do just won't work

--
SSS,
Steve / Strathclyde / Scotland.
------------------------------
Jul 20 '05 #3
Thanks. That takes care of that. Using any other technology?

--
George Hester
__________________________________
"rf" <ma**********@the.time> wrote in message news:_o******************@news-server.bigpond.net.au...

"George Hester" <he********@hotmail.com> wrote in message
news:Bz******************@twister.nyroc.rr.com...
When the address bar is highligted? That is nothing on the page is
selected. The address bar is selected. Capture keydown or keypress? Any
ideas using javascript? Thanks.

Can't be done.

Cheers
Richard.

Jul 20 '05 #4
In article <eO******************@twister.nyroc.rr.com>,
he********@hotmail.com enlightened us with...
Thanks. That takes care of that. Using any other technology?


I believe using IE6+ and a WSH it might be possible...
But that's just a guess. :)

Otherwise you'd have to use .net and a custom browser extenstion.

--
--
~kaeli~
A hangover is the wrath of grapes.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #5
rf

"George Hester" <he********@hotmail.com> wrote in message
news:eO******************@twister.nyroc.rr.com...
Thanks. That takes care of that. Using any other technology?

What precicely are you trying to do?

--
George Hester
__________________________________
"rf" <ma**********@the.time> wrote in message
news:_o******************@news-server.bigpond.net.au...

"George Hester" <he********@hotmail.com> wrote in message
news:Bz******************@twister.nyroc.rr.com...
When the address bar is highligted? That is nothing on the page is
selected. The address bar is selected. Capture keydown or keypress? Any
ideas using javascript? Thanks.

Can't be done.

Cheers
Richard.

Jul 20 '05 #6
Basically what I was trying to do I've given up. The idea was to determine what the tabIndex was upon tabbing through my controls on a form and hitting the address bar. I have 5 controls. 4 on the form and 1 on a link. So there are only 5 "elements" which get the tab. 0, 1, 2, 3 on the form and 4 is the link. I number them explicitly this way. But onkeydown over the 4th one, the link, sends control to the address bar. At that point I cannot capture onkeydown. onkeydown over the link is not captured (fired) when the key is the TAB and the place the cursor goes is the address bar.

The trouble is my tabIndex seems to act inconsistently when the address bar is included in the mix.

--
George Hester
__________________________________
"rf" <ma**********@the.time> wrote in message news:BS******************@news-server.bigpond.net.au...

"George Hester" <he********@hotmail.com> wrote in message
news:eO******************@twister.nyroc.rr.com...
Thanks. That takes care of that. Using any other technology?

What precicely are you trying to do?

--
George Hester
__________________________________
"rf" <ma**********@the.time> wrote in message
news:_o******************@news-server.bigpond.net.au...

"George Hester" <he********@hotmail.com> wrote in message
news:Bz******************@twister.nyroc.rr.com...
When the address bar is highligted? That is nothing on the page is
selected. The address bar is selected. Capture keydown or keypress? Any
ideas using javascript? Thanks.

Can't be done.

Cheers
Richard.


Jul 20 '05 #7
<form>
<input type="text" name="one" tabindex="1">
<input type="text" name="two" tabindex="2">
<input type="text" name="three" tabindex="3">
<input type="text" name="four" tabindex="4" onblur="this.form.elements['one'].focus();">
</form>

Doesn't help if the user hits SHIFT+TAB in the first form element however.

George Hester wrote:
Basically what I was trying to do I've given up. The idea was to determine what the tabIndex was upon tabbing through my controls on a form and hitting the address bar. I have 5 controls. 4 on the form and 1 on a link. So there are only 5 "elements" which get the tab. 0, 1, 2, 3 on the form and 4 is the link. I number them explicitly this way. But onkeydown over the 4th one, the link, sends control to the address bar. At that point I cannot capture onkeydown. onkeydown over the link is not captured (fired) when the key is the TAB and the place the cursor goes is the address bar.

The trouble is my tabIndex seems to act inconsistently when the address bar is included in the mix.

--
George Hester
__________________________________
"rf" <ma**********@the.time> wrote in message news:BS******************@news-server.bigpond.net.au...

"George Hester" <he********@hotmail.com> wrote in message
news:eO******************@twister.nyroc.rr.com...
Thanks. That takes care of that. Using any other technology?

What precicely are you trying to do?

--
George Hester
__________________________________
"rf" <ma**********@the.time> wrote in message
news:_o******************@news-server.bigpond.net.au...

"George Hester" <he********@hotmail.com> wrote in message
news:Bz******************@twister.nyroc.rr.com...
When the address bar is highligted? That is nothing on the page is
selected. The address bar is selected. Capture keydown or keypress? Any
ideas using javascript? Thanks.

Can't be done.

Cheers
Richard.


--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #8
Grant Wagner wrote on 02 jan 2004 in comp.lang.javascript:
<form>
<input type="text" name="one" tabindex="1">
<input type="text" name="two" tabindex="2">
<input type="text" name="three" tabindex="3">
<input type="text" name="four" tabindex="4"
onblur="this.form.elements['one'].focus();"> </form>

Doesn't help if the user hits SHIFT+TAB in the first form element
however.


You can use to "hidden" inputs that only act as tab and shift-tab catch.
They cannot be visibility:hidden or display:none, just style zero-sized.

The tab sequence will be 234523452...

The shift-tab sequence will be 5432543254....

Try:

<script>tabn=false;</script>
<form>
<input style="width:0;height:0;" tabindex="1"
onfocus="if(tabn){tabn=false;this.form.elements['four'].focus();}">
<input type="text" name="one" tabindex="2" onkeydown="tabn=true">
<input type="text" name="two" tabindex="3">
<input type="text" name="three" tabindex="4">
<input type="text" name="four" tabindex="5">
<input style="width:0;height:0;" tabindex="6"
onfocus="this.form.elements['one'].focus();">
</form>

IE6 tested.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Hans | last post by:
Hi! Does anybody of you have a good algorithm to capture when a value in a textbox is changed? I'm using the keypress/keydown events but they seems to be a bit inconsistent (IE and Mozilla)....
7
by: (Pete Cresswell) | last post by:
I've got KeyDown coding and it fires when other keys are pressed, but when Enter is pressed, nothing. I'd like to support the (standard?) Windows behavior of executing DblClick processing when...
3
by: Keith Smith | last post by:
Whenever a Keydown EventHandler is processed the computer never continues on to process the KeyPress EventHandler. Is there a way to stop this? My goal is to be able to detect these keys from...
10
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? ...
7
by: Bob Achgill | last post by:
When I use the code for KeyPress to capture pressing a certain key for processing on a form with no Text Box it works. But when I try the same code on my application that has text boxes it does...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
1
by: windy | last post by:
What's the difference between Keypress and KeyDown event? looks like some key cannot be handled by both event. Can anyone list out the details and their usage for best pratice?
2
by: Tony Johansson | last post by:
Hello! I have created a Control that consist of a label and a textbox.I have called this class ctlLabelTextbox. public partial class ctlLabelTextbox : UserControl { .... } The class that I...
14
by: raylopez99 | last post by:
KeyDown won't work KeyPress fails KeyDown not seen inspired by a poster here:http://tinyurl.com/62d97l I found some interesting stuff, which I reproduce below for newbies like me. The main...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.