In my idea all the combinations are going to look like Num0 + Num X (where x є [1,9]) and it's working fine, but bacause of limited number of such combinations to get capital letters
I wanted to check if shift is pressed and then decide what letter is sent. Also I'm using a few languages, so I'm checking the keyboard layout.
So the problem is that I cannot check if shift is pressed and get the "Num0 + Num1" combination work in the right way.
I'm attaching code, that I was using.
P.S. I`m new at scripting, I`m still learning and I believe that some of you can help me solve this problem.
Code: Select all
#If GetKeyboardLanguage(WinExist("A")) = 0x0422 or GetKeyboardLanguage(WinExist("A")) = 0x0419
Numpad0 & Numpad1::
if GetKeyState("Shift","p")
Send, З ; That's not three, but cyrylic letter placed at the "P" key.
else
send, з
return
#If
Numpad0 & Numpad1::send, p
GetKeyboardLanguage(_hWnd=0)
{
if !_hWnd
ThreadId=0
else
if !ThreadId := DllCall("user32.dll\GetWindowThreadProcessId", "Ptr", _hWnd, "UInt", 0, "UInt")
return false
if !KBLayout := DllCall("user32.dll\GetKeyboardLayout", "UInt", ThreadId, "UInt")
return false
return KBLayout & 0xFFFF
}