MI GORDITA
,
Saturday, 14th of August 2010 07:20:47 PM
Well, l just wanna know how to make a batch file make the LED lights on a
MI GORDITA
keyboard 'flash' (Turn on and off fast)
If it can not be dont
Registered User
in a batch file can it be dont in C#?
Thanks
Joined: Sunday, 9th of May 2010, 21:03:10
Posts: 681
Viewed 12000 times
MissFlexa
,
Sunday, 15th of August 2010 06:01:22 PM
There is not a batch command as such, but there is a win32 api
MissFlexa
that will let you do it in VB VC & VC#
Registered User
Joined: Thursday, 13th of May 2010, 01:51:09
HOWTO: Toggle the NUM LOCK, CAPS LOCK, & SCROLL LOCK Keys
Posts: 1089
Last reviewed: December 5, 1997
Viewed 7554 times
Article ID: Q127190
3.50 3.51 | 4.00 WINDOWS NT | WINDOWS kbui kbcode
The information in this article applies to:
Microsoft Win32 Application Programming Interface (API) included with:
- Microsoft Windows NT versions 3.5 & 3.51
- Microsoft Windows 95 version 4.0
SUMMARY
The documentation for SetKeyboardState() correctly says that you cannot
use this API to toggle the NUM LOCK, CAPS LOCK, & SCROLL LOCK keys.
You can use keybd_event() to toggle the NUM LOCK, CAPS LOCK, & SCROLL LOCK
keys under Windows NT. The same technique works for toggling CAPS LOCK &
SCROLL LOCK under Windows 95, but it will not work for NUM LOCK.
MORE INFORMATION
The following sample program turns the NUM LOCK light on if it is off. The
SetNumLock function defined here simulates pressing the NUM LOCK key, using
keybd_event() with a virtual key of VK_NUMLOCK. It takes a boolean value
that indicates whether the light should be turned off (FALSE) or on
(TRUE).
The same technique can be used for the CAPS LOCK key (VK_CAPITAL) & the
SCROLL LOCK key (VK_SCROLL).
Sample Code
/* Compile options needed:
*/
#include
void SetNumLock( BOOL bState )
{
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (bState && !(keyState[VK_NUMLOCK] & 1)) ||
(!bState && (keyState[VK_NUMLOCK] & 1)) )
{
// Simulate a key press
keybd_event( VK_NUMLOCK,
0x45,
KEYEVENTF_EXTENDEDKEY | 0,
0 );
// Simulate a key release
keybd_event( VK_NUMLOCK,
0x45,
KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,
0);
}
}
void main()
{
SetNumLock( TRUE );
}
--------------------------------------------------------------------------------
Additional reference words: 3.50 4.00 95
KBCategory: kbui kbcode
KBSubcategory: UsrInp
Keywords : UsrInp kbcode kbui
Version : 3.50 3.51 | 4.00
Platform : NT WINDOWS
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED ''AS
IS'' WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES,
EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION
OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT,
INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL
DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
FOREGOING LIMITATION MAY NOT APPLY.
Last reviewed: December 5, 1997