Alert box obstructs key up events

L

Laser Lips

If I had events for key up and key down, If I was holding down the
shift key and I did something on the page which sparked an alert box
and then let go of the key while the alert box was still present, the
key up event does not fire and neither does a key press event.

Can anyone tell me how to get round this?

Thanks,
Graham
 
R

rf

Laser said:
If I had events for key up and key down, If I was holding down the
shift key and I did something on the page which sparked an alert box
and then let go of the key while the alert box was still present, the
key up event does not fire and neither does a key press event.

Can anyone tell me how to get round this?

You don't. The alert box has the focus and receives the events.

Incidently this reminds me of one of the ways to defeat those stupid
no-right-click things that pop up an alert saying "you can't save my
images". Simply press enter (to dismiss the alert) and then release the
mouse button and the friendly context menu appears :)
 
L

Laser Lips

You don't. The alert box has the focus and receives the events.

Incidently this reminds me of one of the ways to defeat those stupid
no-right-click things that pop up an alert saying "you can't save my
images". Simply press enter (to dismiss the alert) and then release the
mouse button and the friendly context menu appears :)

Thanks, in that case I need a way of testing whether the Shift or Crtl
keys are pressed.

Any ideas on that?

Graham
 
T

The Natural Philosopher

rf said:
You don't. The alert box has the focus and receives the events.

Incidently this reminds me of one of the ways to defeat those stupid
no-right-click things that pop up an alert saying "you can't save my
images". Simply press enter (to dismiss the alert) and then release the
mouse button and the friendly context menu appears :)

The best answer to alert boxes is to create a popup box you design yourself.

You can have it any style you want, any z-index you want, and control it
completely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top