views:

161

answers:

1

Hello,

I'm using keyboard events ('keydown' and 'keyup') to detect exactly when the user presses or releases the shift key.

In Safari 3+, this works fine. However, Safari 2.0 doesn't seem to fire keyboard events for the shift key—in fact, it doesn't seem to fire events for any of the modifier keys...

Does anyone know how I might deal with or work around this problem?

(In this particular case, I only need to work with Safari, as I'm using this code in a Dashboard widget.)

Thanks,

Steve

+2  A: 

Safari 2 does not fire key events for any modifier keys (the code wasn't added until the S3 cycle) -- the best you could do is look at the modifier flags on any events you are processing.

Failing that, remember that Safari 3+ exist on tiger, and iirc are part of 10.4.11 so you should really be able to rely on the existence of S3+

olliej
Unfortunately, the version of WebKit in Tiger's Dashboard is separate from the version of Safari installed. This has been fixed in Leopard.Thanks,Steve
Steve Harrison
Dammit, i forgot about that :-(It's largely due to tiger widgets making heavy use of "features" the are in reality bugs in the Safari 2 webkit :-/
olliej