Veljean
asked on
Intercept Key events in a Black Berry with JavaScript
I'm trying to intercept key events using javascript.
In my script im getting the unicode like this:
var unicode=evtobj.charCode? evtobj.charCode : evtobj.keyCode
and validating it with a IF statement for example:
if (unicode==50)
do something ...
Although in PC browsers this works fine in the BlackBerry doesn't ... I have tried in Nokia and LG phones and works perfectly, Is there another way to do this? because i can figure out that BlackBerry doesn't support these kind of instructions...
In my script im getting the unicode like this:
var unicode=evtobj.charCode? evtobj.charCode : evtobj.keyCode
and validating it with a IF statement for example:
if (unicode==50)
do something ...
Although in PC browsers this works fine in the BlackBerry doesn't ... I have tried in Nokia and LG phones and works perfectly, Is there another way to do this? because i can figure out that BlackBerry doesn't support these kind of instructions...
ASKER
Yes b0Isc0tt , the option "JS enabled" is already checked in my BlackBerry , and I added an alert to the event to see what happens without success, like I said in a nomal PC browser and other cellphones (not blackberry) the script works perfectly. I will try your statement as soon as I can (unfortunately today I have run into other issues that make impossible to test it) I hope we can keep us in touch...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you verified Javascript works? Add an alert or some script to the event to see if it even exists. If it does then you might try ...
var unicode=evtobj.charCode? evtobj.charCode : (evtobj.keyCode)? evtobj.keyCode : evtobj.which;
Let me know if you have any questions or need more information.
b0lsc0tt