473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Problem with focus and keystrokes in IE 6 and 7

I made an interactive webpage, wich should be controlled with
keystrokes via javascript. My problem is, that in IE6 (witch latest
update) and IE 7 it does only work, when I place a mouseclick into the
page. No matter where. Then the keystroke is recognized and the desired
function (one page further) works. When the new page is loaded, the
problem starts again. The keystrokes are just recognized when I click
into the page.
Can anyone help me?

Thanks,
Johannes

Nov 6 '06 #1
2 1355
hitide schrieb:
I made an interactive webpage, wich should be controlled with
keystrokes via javascript. My problem is, that in IE6 (witch latest
update) and IE 7 it does only work, when I place a mouseclick into the
page. No matter where. Then the keystroke is recognized and the desired
function (one page further) works. When the new page is loaded, the
problem starts again. The keystrokes are just recognized when I click
into the page.
Can anyone help me?
I am not sure, but it is possible that in IE the focus is somewhere
outside the viewport when a page is loaded. Try to put the focus
somewhere inside the page on load:

<body onLoad="document.getElementById('startHere').focus ()">
<div id="startHere">Now I guess the focus is here</div>

I have not tested this, though - it is just an idea.

--
Markus
Nov 6 '06 #2
Thanks for the quick answer, but unfortunally it does not work.
So I sit and wait for a new inspiration....

Thanks,
Johannes

Markus Ernst wrote:
hitide schrieb:
I made an interactive webpage, wich should be controlled with
keystrokes via javascript. My problem is, that in IE6 (witch latest
update) and IE 7 it does only work, when I place a mouseclick into the
page. No matter where. Then the keystroke is recognized and the desired
function (one page further) works. When the new page is loaded, the
problem starts again. The keystrokes are just recognized when I click
into the page.
Can anyone help me?

I am not sure, but it is possible that in IE the focus is somewhere
outside the viewport when a page is loaded. Try to put the focus
somewhere inside the page on load:

<body onLoad="document.getElementById('startHere').focus ()">
<div id="startHere">Now I guess the focus is here</div>

I have not tested this, though - it is just an idea.

--
Markus
Nov 6 '06 #3

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

Similar topics

0
by: Aravind | last post by:
Hi folks. I am using Access 97. I have a form, frmHistory, which has 2 combo boxes (cboSelectTitle and cboSelectName) and 2 text boxes (Title and MemName). When the form is opened, it displays...
6
by: Niksa Baldun | last post by:
Hi, I am trying to capture data from magnetic stripe reader which is connected via keyboard interface (therefore indistinguishable from normal keyboard input). Basically, I am doing the...
2
by: Matthew | last post by:
I want to create a program that runs in the system tray and watches for key combinations (Ctrl. + Shift + 1, for example) and performs an action associated with that combination. The catch is...
8
by: Tom | last post by:
I am using VB.NET to control another program. I have the program's window hwnd; however, I need to be able to set the focus to that other programs window so I can send it some keystrokes. I thought...
2
by: Tom | last post by:
I am developing a VB.NET user control that is composed of a component control (along with some classes, etc). This is probably a stupid question, and should be easy, but I must be having a brain...
4
by: Tom | last post by:
Another question relating to focus: Is it possible to set the focus to another program's window and send it keystrokes, YET still keep my VB program in the foreground (i.e. showing on the screen)?...
5
by: annagel | last post by:
I am looking for a way to force a Tkinter window into focus on a system level. I know the force focus method should bring one window of my application into focus, but it seems I need to have some...
13
by: alvinwoon | last post by:
URL: http://events.unl.edu/ Description: i coded a quick and dirty key navigation for the calendar. if you press left arrow on your keyboard, it will navigate to the previous date and fire an...
2
by: milund | last post by:
Hi, I am in the process of writing a custom control. In the OnMouseDown method I call this.Focus() to enable the control to receive keystrokes in OnKeyDown(). My control is hosted in a MDI form....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.