Sign in with
Sign up | Sign in
Your question

Pocket IE and Javascript OnKeyDown function

Last response: in Cell Phones & Smartphones
Share
Anonymous
September 2, 2004 5:20:13 AM

Archived from groups: microsoft.public.pocketpc (More info?)

I have a Symbol 9060G scanner. This scanner runs Windows
Mobile 2003. I have a non-modifiable web application
that uses the OnKeyDown JavaScript function. This
function operates fine with IE 6.0 on my XP computer, but
on the scanner it doesn't work. I get no JavaScript
error, the key presses on the external keyboard just
don't active the function. Any ideas? Have others had
luck with this function working in Pocket IE?

Thanks
Eric
Anonymous
September 2, 2004 4:03:27 PM

Archived from groups: microsoft.public.pocketpc (More info?)

Pocket IE supports JScript, a simplified version of Javascript. It is very
possible that the function you are using is not supported.

--
Helio Diamant - MS/MVP Mobile Devices
http://www.pocketpcfreak.com


"Eric Halbur" <anonymous@discussions.microsoft.com> wrote in message
news:4b4601c490c5$ab5d44f0$a301280a@phx.gbl...
> I have a Symbol 9060G scanner. This scanner runs Windows
> Mobile 2003. I have a non-modifiable web application
> that uses the OnKeyDown JavaScript function. This
> function operates fine with IE 6.0 on my XP computer, but
> on the scanner it doesn't work. I get no JavaScript
> error, the key presses on the external keyboard just
> don't active the function. Any ideas? Have others had
> luck with this function working in Pocket IE?
>
> Thanks
> Eric
>
Anonymous
September 2, 2004 5:17:05 PM

Archived from groups: microsoft.public.pocketpc (More info?)

Sure. This page states PIE supports onchange, onfocus and onblur
events form WM2002 and later operating systems.

http://msdn.microsoft.com/library/en-us/apippc/html/ppc...

That's all - there's no onkeyup for PIE form elements. Since your web
app isn't modifiable (I find that hard to believe though), then you're
out of luck unless you can change the requirements for trapping keup
events.

Onchange might do it - this event fires when the form element's value
has changed *and* the element blurs (that is, when another page
element receives focus). In practice, this means the user must click
outside the text area, on the page background or a botton or other
screen area.

Netfront seems to have the same lack of onkeyup if it's any help.

However as always there's a workaround : You need to use setTimeout to
'scan' the value of the text box lets say every 50ms or so. The code
below does this (and it inserts the value into a second text box so
you can see the result - modifying it is trivial)


<html>
<head>
<title>Simulate keyup changes</title>
<script language="javascript">
// Set initial value to check against
var curvalue="";
function getTimeout() {
dv=document.forms["keys"].send.value;
df=document.forms["keys"].get;
if (dv !=curvalue) {
curvalue=dv;
// Change value to current text box content
df.value=dv;
// Or use your own function here instead
}
// Repeat ever 50 millisec or interval of your choice
window.setTimeout(getTimeout,50);
}
</script>
</head>

<body onload="getTimeout()">

<form name="keys" id="keys">
Input : <input type="text" name="send" id="send" size="12"
maxlength="24" />


Output : <input type="text" name="get" id="get" size="12"
maxlength="24" />
</form>

</body>
</html>



HTH
Cheers - Neil


On Thu, 2 Sep 2004 01:20:13 -0700, "Eric Halbur"
<anonymous@discussions.microsoft.com> wrote:

>I have a Symbol 9060G scanner. This scanner runs Windows
>Mobile 2003. I have a non-modifiable web application
>that uses the OnKeyDown JavaScript function. This
>function operates fine with IE 6.0 on my XP computer, but
>on the scanner it doesn't work. I get no JavaScript
>error, the key presses on the external keyboard just
>don't active the function. Any ideas? Have others had
>luck with this function working in Pocket IE?
>
>Thanks
>Eric
!