views:

350

answers:

2

How can I get the state of a modifier key using VB.NET on the Compact Framework, in this case Windows Mobile 6.1. I want to be able to determine if the following keys are pressed or locked:

Shift CTRL ALT

and for the Psion Teklogix machines Orange Blue Although I may be able to work this out, if I can determine the others.

I want to create my own on-screen indicator panel and want to poll the keys, not using events.

Thanks Colin

A: 

So there is the AllKeys function. Probably the best way to go today.

just say no to GAPI – What you need to know about AllKeys and input management.

And this link should give you the P/Invoke to use in managed code.

Capture all Windows Mobile device keys using the AllKeys API

CJCraft.com
A: 

Hi Colin,

did you solve this problem? I'm interested in this too. I need to access the blue, orange and other psion teklogix specific buttons. With the AllKeys API I couldn't catch them in .net. Thanks!

nec
Yes I solved it on the Psion using their API, specifically:Imports PsionTeklogix.KeyboardThis is my code for updating some indicators on the screen.The modifiers are key.alt, key.control, key.shift, key.blue and key.orangeThere are three states keystate.oneshot, keystate.lock, keystate.offA typical check will look like :if keyboard.getmodifierkeystate(key.alt)=keystate.oneshot then //Do stuff hereend ifHope this is of some helpColin
CDM