Avatar of dsacker
dsacker
Flag for United States of America asked on

Windows Mobile 6.5 Internet Explorer OnKeyPress Not Exposed

I have designed an ASP web page for scanning contents that go into crates, as well as the crates themselves (all are barcoded), which then inputs all of the job materials into an ERP database. It uses JavaScript to handle the onkeypress, grabs the ENTER keyCode (which is the end of the scanner's throughput), then uses AJAX to call server-side ASP code to do the database work.

It works beautifully on any desktop or laptop with an attached scanner. However, it does not work on a handheld device with Windows Mobile OS. :(

A lengthy research has verified that the onkeypress, onkeydown, onkeyup events (as well as others) are not exposed in Internet Explorer on Windows Mobile OS.

A dirty work-around is to code a setTimeout to check for value changes on the INPUT text fields (there are only 8 of them), so that is not too bad.

However, has anyone found a solution or way to expose the onkeypress/etc events and expose them to web pages in IE? (Without having to write your own WinApp browser control, turning it on in .NET, or purchase a commercial browser that does the same?)

It's a shame that Microsoft will tell you how to turn it on within your Windows Forms development (I've been to their MSDN solution page), but won't even go there regarding web pages, to the chagrin of not a few bloggers and forums.

Anyone got a rabbit in the hat on this?
Windows OSAJAXJavaScript

Avatar of undefined
Last Comment
leakim971

8/22/2022 - Mon
SOLUTION
alexey_gusev

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
leakim971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
dsacker

ASKER
Alexey, yes, that's a tad much. Seems less painful is the "dirty workaround" (yep, that's the link I found, leakim971).

This is really a pain, that Microsoft would not automatically expose these events to IE, considering their OS would be used on hand-held devices (as well as phones). Seems a bit short-sighted on their part. (I know, I'm whining *lol*.)

I am looking at another possible solution, a commercial browser called "Pocket Browser" from Motorola. If this does the trick, since it's for a manufacturing company, I may go with it.

Was hoping someone has been down this road with a clean solution?
alexey_gusev

have you tried other browsers like Opera?
leakim971

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
dsacker

ASKER
Well, if this is any comfort to anyone (it is to me), the onChange event works, howbeit with some limitations.

The variables "this" and "event" are not available (or at least, seem to not be available) to any handler.

However, you can pass the name or id of the field your own, for example:

<input type="text" name="employee" id="employee" onChange="onChange_Click('employee');" />

Then the javascript function would be as follows:

function onChange_Click(field)

I've been able to march ahead satisfactorily on the hand-held. Also, I had to not set some of the data-wedge settings to pass the enter and/or tab keys.

Of course, I lose the ability to revalidate any field that doesn't have a value change, but it's a price I can live with.
ASKER CERTIFIED SOLUTION
dsacker

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
dsacker

ASKER
Anyway, I'll share the points, simply for the discussion.
dsacker

ASKER
I wish to split the points with both alexey_gusev and leakim971, while pointing to the solution I discovered as the main solution, but not sure how to do that.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
leakim971

Thanks for the points!