Any work-around? Opera 9 and keyCode

P

Paul Gorodyansky

Hi,

I have function that works via onkeypressed -

for example, what to catch when a user presses a punctuation symbol
such as '.'

So I check keyCode for that - works just fine in
Opera 8, Mozilla/Firefox, IE

But in Opera 9 my code catches _both_ '.' and Delete button pressed -
both return 46 as a keyCode.


keyCode = evt.keyCode ? evt.keyCode :
evt.charCode ? evt.charCode :
evt.which ? evt.which : void 0;


CurrentKey = String.fromCharCode(keyCode) -

value is "." in _both_ cases.

In Opera 8, Mozilla/Firefox, IE the function working via
onkeypressed is NOT even called when I press Delete button...


I don't believe I am the first person to ran into this issue so
I hope some one has already figure out what to do -
don't let Opera 9 'think' that '.' was pressed when Delete button
was pressed.
 
P

Paul Gorodyansky

function that works via OnKeyDown showed more details -
unlike onkeypressed it _is_ called when Delete button is pressed.

So Opera 9 has a bug?

According to the value table for example here: http://tinyurl.com/pnjx4

keyCode value for Delete key is 46 while for a dot - '.' - value is 190

Firefox and IE show exactly that in the function called via onkeydown -
190 and 46

while Opera 9 shows 46 for _both_ Delete key abd '.'!

That is, it gives wrong value for '.'

Bug? Is it possible to find a work-around?
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top