You could try GetKeyState(). Generally, though, when you're using
keybd_event(), you're bypassing most of the input processing and so standard
functions won't work as they will with real keyboard drivers.
Paul T.
"mcm" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Paul,
>
> This looks promising, and works when I attach a physical keyboard to my
> device.
>
> However, my device has a hardware keypad (series of switches). I handle
> these switches so that they act like a keyboard through the use of
> keybd_event calls.
>
> For example, my hardware EXIT button is treated as the escape key via:
>
> keybd_event(0x1B, 0x45, 0, 0); // Esc key
>
> My problem is that software keybd_event's don't seem be be detected with
> GetAsyncKeyState.
> Do I need to do something different with my keybd_event call's so that
> they can be detected by GetAsyncKeyState?
>
> - mcm
>
>
>
>>GetAsyncKeyState(). You'll have to P/Invoke it, of course.
>>
>>Paul T.
>>
>>"mcm" <(E-Mail Removed)> wrote in message
>>news:u5%(E-Mail Removed)...
>>> I'm stuggling with a seemingly simple issue.
>>>
>>> Inside a C# (Windows CE application, I have a function that handles a
>>> measurement.
>>> During the measurement, I need to check the keyboard to see if the
>>> Escape
>>> (27) key has been hit and I can't find a way to do this.
>>> I'd like to look through any buffered keystrokes - remove the ones I'm
>>> not
>>> interested in and look for an "escape", but I'm not finding any info.
>>>
>>> private Boolean HandleMeasurement()
>>> {
>>> Boolean bMeasuring = true;
>>> Boolean bAbort = false;
>>>
>>> while (SystemIsMeasuring() && (!bAbort))
>>> {
>>> // load the available data
>>> GetMyData();
>>>
>>> // test for keyboard input, if cancel was pressed set bAbort = true
>>> bAbort = IDontHaveAClueHowToDoThis();
>>> }
>>>
>>> }
>>>
>>> My question: what should the "IDontHaveAClueHowToDoThis()" function
>>> look
>>> like?
>>>
>>> Thanks,
>>>
>>> - mcm
>>>
>>
>
|