forked from neo/neo-layout
neovars: fix keyboard LEDs (DllCall + unicode string)
This commit is contained in:
parent
00649b9409
commit
2687ece681
|
@ -39,16 +39,13 @@ KeyboardLED(LEDvalue, Cmd){ ; LEDvalue: ScrollLock=1, NumLock=2, CapsLock=4 ; Cm
|
||||||
KeyLED:=LEDvalue & (GetKeyState("ScrollLock","T") + 2*GetKeyState("NumLock","T") + 4*GetKeyState("CapsLock","T"))
|
KeyLED:=LEDvalue & (GetKeyState("ScrollLock","T") + 2*GetKeyState("NumLock","T") + 4*GetKeyState("CapsLock","T"))
|
||||||
}
|
}
|
||||||
; EncodeIntegerLED(KeyLED,1,&input,2) ;input bit pattern (KeyLED): bit 0 = scrolllock ;bit 1 = numlock ;bit 2 = capslock
|
; EncodeIntegerLED(KeyLED,1,&input,2) ;input bit pattern (KeyLED): bit 0 = scrolllock ;bit 1 = numlock ;bit 2 = capslock
|
||||||
input:=Chr(1) Chr(1) Chr(KeyLED)
|
|
||||||
input:=Chr(1)
|
|
||||||
input=
|
|
||||||
success:=DllCall("DeviceIoControl"
|
success:=DllCall("DeviceIoControl"
|
||||||
, "uint", h_device
|
, "ptr" , h_device
|
||||||
, "uint", CTL_CODE_LED( 0x0000000b ; FILE_DEVICE_KEYBOARD
|
, "uint", CTL_CODE_LED( 0x0000000b ; FILE_DEVICE_KEYBOARD
|
||||||
, 2
|
, 2
|
||||||
, 0 ; METHOD_BUFFERED
|
, 0 ; METHOD_BUFFERED
|
||||||
, 0 ) ; FILE_ANY_ACCESS
|
, 0 ) ; FILE_ANY_ACCESS
|
||||||
, "uint", &input
|
, "int*", KeyLED << 16
|
||||||
, "uint", input_size
|
, "uint", input_size
|
||||||
, "uint", 0
|
, "uint", 0
|
||||||
, "uint", 0
|
, "uint", 0
|
||||||
|
@ -77,10 +74,8 @@ NtCreateFileLED(ByRef wfilename,desiredaccess,sharemode,createdist,flags,fattrib
|
||||||
}
|
}
|
||||||
|
|
||||||
SetUnicodeStrLED(ByRef out, str_){
|
SetUnicodeStrLED(ByRef out, str_){
|
||||||
VarSetCapacity(st1, 8, 0)
|
VarSetCapacity(out, 2*StrPut(str_, "utf-16"))
|
||||||
InsertIntegerLED(0x530025, st1)
|
StrPut(str_, &out, "utf-16")
|
||||||
VarSetCapacity(out, (StrLen(str_)+1)*2, 0)
|
|
||||||
DllCall("wsprintfW", "str", out, "str", st1, "str", str_, "Cdecl UInt")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExtractIntegerLED(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4){
|
ExtractIntegerLED(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4){
|
||||||
|
|
Loading…
Reference in New Issue