Re: GetKeyState() problem
From: Paul G. Tobey [eMVP] (ptobey_no_spam_at_instrument_no_spam.com)
Date: 02/10/04
- Next message: sc: "Re: DHCP Request not working"
- Previous message: joe: "Re: USB Mass Storage driver V4.2"
- In reply to: Jim Merkle: "Re: GetKeyState() problem"
- Next in thread: Jim Merkle: "Re: GetKeyState() problem"
- Reply: Jim Merkle: "Re: GetKeyState() problem"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 10 Feb 2004 13:03:15 -0700
No, no layout manager stuff.
I don't have any idea whether it changed or not. The documentation has, I
believe, always indicated that GetAsynchKeyState() was the right way to find
out the key state at this very instant. Maybe the layout manager stuff gave
MS a push to make it actually work that way.
Paul T.
"Jim Merkle" <jimmerkle@hotmail.com> wrote in message
news:eCS8HtA8DHA.1804@TK2MSFTNGP12.phx.gbl...
> I've used GetKeyState() in CE2.12, CE3.0, and now in 4.2. In all
previous
> versions of CE, it would return the input system's current keyboard flag
> values.
>
> My matrix keyboard does not export any of the Layout Manager Interfaces.
> (MatrixKB.def) Does your keyboard driver export additional Layout Manager
> Interfaces defined in the keyboard's def file?
>
> LayoutMgrGetKeyboardType
> LayoutMgrGetKeyboardLayout
> LayoutMgrGetKeyboardLayoutName
> LayoutMgrGetKeyboardLayoutList
> LayoutMgrLoadKeyboardLayout
> LayoutMgrActivateKeyboardLayout
> IL_00000409
> PS2_AT_00000409
>
>
> In previous versions of CE, any thread could call this API to determine
the
> input system's understanding of these modifier flags.
>
> Did this API change scope, or is this Layout Manager layer somehow
involved?
> Adding the Layout Manager Layer is a fairly invasive task.
>
> Thanks,
>
> Jim
>
> "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> message news:uF6yfC27DHA.3288@TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > Well, our device and its driver seem to be doing the right thing. Are
you
> > sure that GetKeyState() and not GetAsyncKeyState() is what you want
there?
> > I think that, based on how you're trying to use GetKeyState() it won't
> work.
> > If you read the help in eVC 4 on GetKeyState() you'll see that its
return
> > value is based on the current state, as far as the message pump for the
> > current thread knows, and you aren't running a message pump there.
> >
> > Paul T.
> >
> > "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> > message news:OApGC517DHA.2644@TK2MSFTNGP11.phx.gbl...
> > > Jim,
> > >
> > > Hmmm. Well, I don't think that they are required, no. Our driver
> doesn't
> > > conform either, right now. Let me try some GetKeyState() tests and
see
> > what
> > > I see.
> > >
> > > Paul T.
> > >
> > > "Jim Merkle" <jimmerkle@hotmail.com> wrote in message
> > > news:%23SjVqf17DHA.2432@TK2MSFTNGP10.phx.gbl...
> > > > The source you are referring to is nk\kernel\kmisc.c,
> SC_GetKeyState().
> > > > That is the kernel's method of accessing this function. Coredll.dll
> > > > provides access to this function as well (ordinal 860).
> > > >
> > > > Since none of the keyboard drivers export anything like this
function,
> > it
> > > > isn't part of a keyboard driver, and is contained in another module.
> > > >
> > > > Since my keyboard driver doesn't conform to the Layout Manager
> > Interface,
> > > I
> > > > was wondering if that had anything to do with it...? Are the Layout
> > > Manager
> > > > Interface routines requires as of 4.2?
> > > >
> > > >
> > > > Jim
> > > >
> > > >
> > > >
> > > > "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote
> in
> > > > message news:eLj9xl07DHA.2712@tk2msftngp13.phx.gbl...
> > > > > The source for GetKeyState() is in the private source code that
> ships
> > > with
> > > > > PB4.2. It appears to me that the MID_GetKeyState entry in an
array
> of
> > > > > keyboard driver functions is being called with the virtual key
code
> > > passed
> > > > > to it as a parameter...
> > > > >
> > > > > Paul T.
> > > > >
> > > > >
> > > > > "Jim Merkle" <jimmerkle@hotmail.com> wrote in message
> > > > > news:%23Vic3g07DHA.2832@tk2msftngp13.phx.gbl...
> > > > > > Using Windows CE.NET 4.2, with a Matrix Keyboard Driver.
> > > > > >
> > > > > > The keyboard driver is sending the appropriate VK codes to the
> input
> > > > > system
> > > > > > in that the Alt key does produce the menus on the CMD or Pocket
> Word
> > > > > > applications.
> > > > > >
> > > > > > Does 4.2 route the GetKeyState() though new Keyboard APIs that
I'm
> > not
> > > > > > exposing?
> > > > > >
> > > > > > Jim M.
> > > > > >
> > > > > >
> > > > > > "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com>
> wrote
> > > in
> > > > > > message news:%23Mg6HQ07DHA.2676@TK2MSFTNGP10.phx.gbl...
> > > > > > > What kind of device and what version of the OS is this running
> on?
> > > > > > >
> > > > > > > Paul T.
> > > > > > >
> > > > > > > "Jim Merkle" <jimmerkle@hotmail.com> wrote in message
> > > > > > > news:On%23mkK07DHA.1428@TK2MSFTNGP12.phx.gbl...
> > > > > > > > It seems I can't read the state of my Alt, Control, or Shift
> > > > flags....
> > > > > > > >
> > > > > > > > The following code was generated to return the status of
these
> > > > flags:
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
//--------------------------------------------------------------------------
> > > > > > > > --------
> > > > > > > > int WINAPI WinMain( HINSTANCE hInstance,
> > > > > > > > HINSTANCE hPrevInstance,
> > > > > > > > LPTSTR lpCmdLine,
> > > > > > > > int nCmdShow)
> > > > > > > > {
> > > > > > > > for(int i=0;i<400;i++)
> > > > > > > > {
> > > > > > > >
> > > > > > > > SHORT sControl = GetKeyState(VK_CONTROL);
> > > > > > > > RETAILMSG(1,(L"sControl: 0x%X\r\n",sControl));
> > > > > > > >
> > > > > > > > SHORT sShift = GetKeyState(VK_SHIFT);
> > > > > > > > RETAILMSG(1,(L"sShift: 0x%X\r\n",sShift));
> > > > > > > >
> > > > > > > > SHORT sAlt = GetKeyState(VK_MENU);
> > > > > > > > RETAILMSG(1,(L"sAlt: 0x%X\r\n",sAlt));
> > > > > > > >
> > > > > > > > SHORT sCaps = GetKeyState(VK_CAPITAL);
> > > > > > > > RETAILMSG(1,(L"sCaps: 0x%X\r\n",sCaps));
> > > > > > > >
> > > > > > > > Sleep(800);
> > > > > > > >
> > > > > > > > }
> > > > > > > >
> > > > > > > > return 0;
> > > > > > > > } // WinMain
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
//--------------------------------------------------------------------------
> > > > > > > > --------
> > > > > > > >
> > > > > > > > The debug messages only return 0x0 regardless of the state
of
> > the
> > > > > input
> > > > > > > > system "flags".
> > > > > > > >
> > > > > > > > If you have any ideas, please let me know...
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Jim Merkle
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: sc: "Re: DHCP Request not working"
- Previous message: joe: "Re: USB Mass Storage driver V4.2"
- In reply to: Jim Merkle: "Re: GetKeyState() problem"
- Next in thread: Jim Merkle: "Re: GetKeyState() problem"
- Reply: Jim Merkle: "Re: GetKeyState() problem"
- Messages sorted by: [ date ] [ thread ]