Re: get the array of keycodes for the keys that were pressed
It is the same API you are already using!!!
You are currently checking for a single flag -- SKF_STICKYKEYSON. You have
to check for some of the other flags, thats all.
Trigeminal Software, Inc. -- http://www.trigeminal.com/
International VB? -- http://www.i18nWithVB.com/
C++? MSLU -- http://msdn.microsoft.com/msdnmag/issues/01/10/
"vasantha" <firstname.lastname@example.org> wrote in message
> Thanks for your response. But, I did look into the PSDK help but was not
> able to find what I was looking for. Here's what I am currently doing:
> In my Form.KeyDown event, I make a call to isStickyKeysOn method and if it
> is on, then I want to know which of the keyboard keys were pressed. For
> if the keyboard keys that were pressed were Alt and 'A' then, I would
> the corresponding action for Alt+A. The part I am not sure how to do is to
> - get the array of keycodes for the keys that were pressed.
> I looked into the GetKeyboardState API call. But, using that would require
> me to go through all the 256 characters in the list and find out the ones
> that are on (pressed). Is there any other way of doing this.
> Could yo please point me to the help topic that you have mentioned.
> Your help is much appreciated.
> Public Function isStickyKeysOn() As Boolean
> Dim mk As STICKYKEYS
> Dim retval As Long
> mk.cbSize = Len(mk)
> ' Load the MouseKeys settings into the structure.
> retval = SystemParametersInfo(SPI_GETSTICKYKEYS, Len(mk), mk, 0)
> If (mk.dwFlags And SKF_STICKYKEYSON) = SKF_STICKYKEYSON Then
> isStickyKeysOn = True
> isStickyKeysOn = False
> End If
> End Function
> Michael \(michka\) Kaplan" <email@example.com>
> >Its just with the SPI_GETSTICKYKEYS param. Check out the PSDK help topic
> >the flags to check for....
> >Michael Kaplan
> >Trigeminal Software, Inc. -- http://www.trigeminal.com/
> >International VB? -- http://www.i18nWithVB.com/
> >C++? MSLU -- http://msdn.microsoft.com/msdnmag/issues/01/10/
> >"Vasantha" <firstname.lastname@example.org> wrote in message
> >> Hi,
> >> I am trying to find out what system call I should use in order to be
> >> to read the array of key strokes that the user entered.
> >> I am using the "SystemParametersInfo" call to find if the stickkeys in
> >> system accessibility settings are set to "ON" or "OFF". I have this
> >> working.
> >> FYI: sticky keys are turned on in case the user is not able to click on
> >> keys at a time. For eg: to accomplish the usual Ctrl+Alt+Del, by
> >> the sticky keys ON, the user can click on the Ctrl, the Alt and the Del
> >> individually one at a time and accomplish this.
> >> So, my next task is to read from the system the keys that were entered
> >> then using that information, I can divert control to the various parts
> >> my application. This is the part I am not sure how to do.
> >> I was told by another colleague that this could be accomplished by
> >> another call to "SystemParametersInfo" but using different parameter.
> >> I have not been able to figure this out as yet.
> >> Any help in this regard would be greatly appreciated.
> >> Thanks for your help in advance.
> >> -Vasantha
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL