Jump to content

Control the Keyboard's leds


monoceres
 Share

Recommended Posts

i was really supprised that this is possible, downloaded it as fast as i could and had sadly to see that it does not work with logitech G15 keyboards...

$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")
For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)
Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI"
Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;
MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)
Link to comment
Share on other sites

Thanks all :mellow:

For those of you that the script doesn't work for:

I think that the problem is that I assume that the default windows driver is used or something.

Could you please post what's inside the reg key HKEY_LOCAL_MACHINE\HARDWARE\DeviceMap\KeyboardClass

:(

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Ugh, doesn't work for me.

Heres what in there:

Default (Value Not Set)

\Device\KeyboardClass0 - - - - - - - \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\kbdclass

\Device\KeyboardClass1 - - - - - - - - \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\kbdclass

Link to comment
Share on other sites

Ugh, doesn't work for me.

Heres what in there:

Default (Value Not Set)

\Device\KeyboardClass0 - - - - - - - \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\kbdclass

\Device\KeyboardClass1 - - - - - - - - \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\kbdclass

Hmm, try changing "\Device\KeyboardClass0" to "\Device\KeyboardClass1" in the _OpenKeyboard func.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

DllCall("Kernel32.dll","int","DefineDosDeviceW","dword",$DDD_RAW_TARGET_PATH,"wstr","Keybd","wstr","\Device\000000c9")

It says: \Device\000000c9 is my physical device object name, but its yet to work. :mellow:

Damn, I really thought that would work, well I'm out of ideas. Google doesn't give you that much info either. I'll try asking at SysInternals forum tomorrow, they usually are pretty good with this low-level stuff.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

  • 8 months later...
  • 2 years later...

Hello,

nothing happens here, why?

First of all, thanx for this interesting code, monoceres.

To get a handle for "normal" keyboards(PS/2) in KeyboardClass0 is easy, but getting a handle for HIDs(USB) is difficult.

There a two different ways the OS handles such keyboards, native HID(with own driver) and/or emulated("USB Generic Parent Driver"/usbccgp).

Maybe its possible to detect USB-keyb over this service or get the right keyb over the handler from kbdclass.sys over IRP_MJ_READ

Maybe this helps:

http://www.codeproject.com/KB/recipes/keystroke-hook.aspx #4.0

http://mamedev.org/source/src/osd/windows/ledutil.c.html

or with a dll like this:

http://code.google.com/p/csharp-usb-hid-driver/downloads/list

explained here:

http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/

Link to comment
Share on other sites

  • 6 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...