• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 663
  • Last Modified:

mck-800 keyboard

this keyboard has a lamp besides scrol,caps and num lock
this lamp can be turned off or on by special programs.

I need a code to turn that lamp on and off.



Thanks.
0
f15iaf
Asked:
f15iaf
  • 7
  • 4
  • 2
  • +2
1 Solution
 
DRRYAN3Commented:
Found an NT driver for this keyboard through a google search.  License file named Waytech Development as the author.  Check their website at http://www.waytech.com for info.
0
 
SysExpertCommented:
This is a sophisticated keyboard control program.

http://www.zdnet.com/downloads/stories/info/0,,0000H6,.html
keyboard redefinition Dvorack, keyboard macros, numlock keylock change state etc

I hope this helps !
0
 
f15iafAuthor Commented:
Sorry you'r links don't help i can't find the desired code
0
NEW Internet Security Report Now Available!

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out this quarters report on the threats that shook the industry in Q4 2017.

 
DRRYAN3Commented:
You are probably going to have to ask either the original manufacturer of the keyboard or the authors of the driver for this information.
0
 
roaknogCommented:
// This code does it in ms_dos mode.  To do it in windows you have to go to ring 0 which is differnet for Nt //versus 9x  Do you want code to do it, or an application, and for what os?

#include <conio.h>

void main(){
outp(0x60, 0xFF);
}
0
 
roaknogCommented:
code for driver and dll for windows nt and 9x to get your ring 0:
http://www.internals.com/utilities/winio.zip

code for a vb application to send ports:
http://www.internals.com/utilities/VBDumpPort32.zip
0
 
roaknogCommented:
another application without the dll and sys file included
http://203.157.250.93/win32asm/files/AsmIO.zip
0
 
f15iafAuthor Commented:
outp(0x60, 0xFF);
this code turn that light off how do i turn it on
0
 
f15iafAuthor Commented:
outp(0x60, 0xFF);
this code turn that light off how do i turn it on
0
 
roaknogCommented:
#include<conio.h>
#include<stdio.h>

void main(){
printf("\n\n\tALL on bit 0 = scroll, bit 1 = num lock, bit 2 = cap lock.");
outp(0x60,0xed);
while(inp(0x64)&2);
outp(0x60, 0x07);
printf("\n\n\tHit enter key to turn all off");
getchar();
outp(0x60,0xed);
while(inp(0x64)&2);
outp(0x60, 0x00);
printf("\n\n\tHit enter key to turn only scroll on.");
getchar();
outp(0x60,0xed);
while(inp(0x64)&2);
outp(0x60, 0x01);
printf("\n\n\tHit enter key to turn only num lock on.");
getchar();
outp(0x60,0xed);
while(inp(0x64)&2);
outp(0x60, 0x02);
printf("\n\n\tHit enter key to turn only caps on.");
getchar();
outp(0x60,0xed);
while(inp(0x64)&2);
outp(0x60,0x04);
printf("\n\n\t\a(c)2001 INNIEA PUB. CO.  R%c%cK NOG!\n\n\tThere are other more difficult ways to do this.\n", 153, 142);
}
0
 
f15iafAuthor Commented:
Thanx first of all i've mentioned that there is another lamp besides caps scrol and num lock. i've tried all the values from 1 to 255 to find out the value

231-turns on
230-turns off

I don't use you'r dll file because it's enough to use outp function ,anyway i use delphi language which has a component to access the ports.
0
 
AvonWyssCommented:
How about that:

SetKeyboardState
The SetKeyboardState function copies a 256-byte array of keyboard key states into the calling thread's keyboard input-state table. This is the same table accessed by the GetKeyboardState and GetKeyState functions. Changes made to this table do not affect keyboard input to any other thread.

BOOL SetKeyboardState(
  LPBYTE lpKeyState   // array of virtual-key codes
);
Parameters
lpKeyState
[in] Pointer to a 256-byte array that contains keyboard key states.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
Because the SetKeyboardState function alters the input state of the calling thread and not the global input state of the system, an application cannot use SetKeyboardState to set the NUM LOCK, CAPS LOCK, or SCROLL LOCK (or the Japanese KANA) indicator lights on the keyboard. These can be set or cleared using SendInput to simulate keystrokes.

Windows NT: The keybd_event function can also toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK keys.

Windows 95: The keybd_event function can toggle only the CAPS LOCK and SCROLL LOCK keys. It cannot toggle the NUM LOCK key.

Requirements
  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winuser.h; include Windows.h.
  Library: Use User32.lib.

See Also
Keyboard Input Overview, Keyboard Input Functions, GetAsyncKeyState, GetKeyboardState, GetKeyState, keybd_event, MapVirtualKey, SendInput


So, just call this API function...
0
 
f15iafAuthor Commented:
Setkeyboard state has nothing to do with that lamp and there is no virtual key for that lamp.
num caps and scroll lock have no relation to that lamp.
0
 
AvonWyssCommented:
Sorry, got the wrong call. This API here will toggle the lights:

keybd_event
The keybd_event function synthesizes a keystroke. The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message. The keyboard driver's interrupt handler calls the keybd_event function.

Windows NT/2000: This function has been superseded. Use SendInput instead.

VOID keybd_event(
  BYTE bVk,               // virtual-key code
  BYTE bScan,             // hardware scan code
  DWORD dwFlags,          // function options
  ULONG_PTR dwExtraInfo   // additional keystroke data
);
Parameters
bVk
[in] Specifies a virtual-key code. The code must be a value in the range 1 to 254. For a complete list, see Virtual-Key Codes.
bScan
This parameter is not used.
dwFlags
[in] Specifies various aspects of function operation. This parameter can be one or more of the following values. Value Meaning
KEYEVENTF_EXTENDEDKEY If specified, the scan code was preceded by a prefix byte having the value 0xE0 (224).
KEYEVENTF_KEYUP If specified, the key is being released. If not specified, the key is being depressed.


dwExtraInfo
[in] Specifies an additional value associated with the key stroke.
Return Values
This function has no return value.

Remarks
An application can simulate a press of the PRINTSCRN key in order to obtain a screen snapshot and save it to the clipboard. To do this, call keybd_event with the bVk parameter set to VK_SNAPSHOT.

Windows NT: The keybd_event function can toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK keys.

Windows 95: The keybd_event function can toggle only the CAPS LOCK and SCROLL LOCK keys. It cannot toggle the NUM LOCK key.

The following sample program toggles the NUM LOCK light (on Windows NT only) by 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) and the SCROLL LOCK key (VK_SCROLL).

   #include <windows.h>

   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 );
   }
Requirements
  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winuser.h; include Windows.h.
  Library: Use User32.lib.

See Also
Keyboard Input Overview, Keyboard Input Functions, GetAsyncKeyState, GetKeyState, keybd_event, MapVirtualKey, SetKeyboardState


Sorry for posting the wrong API before.
0
 
f15iafAuthor Commented:
You can't turn on that lamp with key stroke that lamp can be turned on only with special programs such as mail checker designed specialy for this keyboard.
This lamp is not like scrol,num and caps lock lamps.
0
 
f15iafAuthor Commented:
num lock has nothing to do with that lamp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now