independent numberic keyboard Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
surfactant
Posts: 20
Joined: 28 Jun 2019, 01:07

independent numberic keyboard

01 Jul 2019, 22:30

If somebody has been using AHK for many years, I think he does hope the keyboard has as many keys as possile.

Is it possible to make keys on an independent numberic keyboard to have key values different from those of keys on the full keyboard? If yes, it can be used as a truly entended keyboard and great for AHK.

Thank you!
Attachments
ScreenClip.png
ScreenClip.png (25.42 KiB) Viewed 671 times
User avatar
hoppfrosch
Posts: 368
Joined: 07 Oct 2013, 04:05
GitHub: hoppfrosch
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: independent numberic keyboard

01 Jul 2019, 23:43

surfactant
Posts: 20
Joined: 28 Jun 2019, 01:07

Re: independent numberic keyboard

02 Jul 2019, 00:02

Thank you for the reference. I have already some hotkeys of multi-tap and long hold.

It seems that an extended keyboard would be great for one-stroke hotkeys.
surfactant
Posts: 20
Joined: 28 Jun 2019, 01:07

Re: independent numberic keyboard

03 Jul 2019, 22:42

Is it possile for AHK to know whether a key with a certain key value is pressed on the main keyboard or on an independant peripheral keyboard?

I'm not talking about numeric keys and extended numeric keys. They have different key values.

Thank you for your comments!
surfactant
Posts: 20
Joined: 28 Jun 2019, 01:07

Re: independent numberic keyboard

04 Jul 2019, 21:10

Exactly what I'm looking for. Thank you!
surfactant
Posts: 20
Joined: 28 Jun 2019, 01:07

Re: independent numberic keyboard

04 Jul 2019, 21:12

Hi @hoppfrosch It seems that you updated the link recommended. Let me try to understand how it works. Thanks!
MartinJordan
Posts: 7
Joined: 04 Jul 2019, 02:15

Re: independent numberic keyboard

05 Jul 2019, 01:03

ah, I recon the one " Francisco Lopez"
He is an extremely talented South American Guru and a kind one
His works are good, really !

Enjoy
MartinJordan
Posts: 7
Joined: 04 Jul 2019, 02:15

Re: independent numberic keyboard

05 Jul 2019, 03:41

just have a fun with it
nothing serious

Code: Select all

#SingleInstance Force
DetectHiddenWindows, ON
Soundbeep
Soundbeep
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Font, cBlue
Gui, Add, Edit, h300 ReadOnly -VScroll v저쪽이다
Gui, Font, cRed
Gui, Add, Edit, x+10 h300 ReadOnly -VScroll v이쪽이다
Gui, Show,, 키보드 연동 분리
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

OnMessage(0x00FF, "키입력")

SizeofRawInputDeviceList	:= A_PtrSize * 2
SizeofRawInputDevice		:= 8 + A_PtrSize
RIDI_DEVICENAME				:= 0x20000007
RIDI_DEVICEINFO				:= 0x2000000b
RIDEV_INPUTSINK				:= 0x00000100
RID_INPUT					:= 0x10000003

HWND := WinExist("키보드 연동 분리")
Res := DllCall("GetRawInputDeviceList", "Ptr", 0, "UInt*", 개수, UInt, SizeofRawInputDeviceList)
VarSetCapacity(RawInputList, SizeofRawInputDeviceList * 개수)
Res := DllCall("GetRawInputDeviceList", "Ptr", &RawInputList, "UInt*", 개수, "UInt", SizeofRawInputDeviceList)
KeyboardRegistered := 0

Loop % 개수 
{
	Handle := NumGet(RawInputList, (A_Index - 1) * SizeofRawInputDeviceList, "UInt")
	Type := NumGet(RawInputList, ((A_Index - 1) * SizeofRawInputDeviceList) + A_PtrSize, "UInt")
	If (Type <> 1)
		Continue
	키보드개수 ++
	키보드%키보드개수% := Handle		
	Res := DllCall("GetRawInputDeviceInfo", "Ptr", Handle, "UInt", RIDI_DEVICENAME, "Ptr", 0, "UInt *", nLength)
	VarSetCapacity(Name, (nLength + 1) * 2)
	Res := DllCall("GetRawInputDeviceInfo", "Ptr", Handle, "UInt", RIDI_DEVICENAME, "Str", Name, "UInt*", nLength)
	Res := DllCall("GetRawInputDeviceInfo", "Ptr", Handle, "UInt", RIDI_DEVICEINFO, "Ptr", 0, "UInt *", iLength)
	VarSetCapacity(Info, iLength)
	NumPut(iLength, Info, 0, "UInt")
	Res := DllCall("GetRawInputDeviceInfo", "Ptr", Handle, "UInt", RIDI_DEVICEINFO, "UInt", &Info, "UInt *", iLength)
	VarSetCapacity(RawDevice, SizeofRawInputDevice, 0)
	NumPut(RIDEV_INPUTSINK, RawDevice, 4)
	NumPut(HWND, RawDevice, 8)
	DoRegister := 0
	If (KeyboardRegistered = 0)
	{
		DoRegister := 1
		NumPut(1, RawDevice, 0, "UShort")
		NumPut(6, RawDevice, 2, "UShort")
		KeyboardRegistered := 1
	}
	If (DoRegister)
		Res := DllCall("RegisterRawInputDevices", "Ptr", &RawDevice, "UInt", 1, "UInt", 8 + A_PtrSize) 
}
개수 := 1 
Return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GuiClose:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Soundbeep
Soundbeep
ExitApp

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
키입력(wParam, lParam, msg, hwnd)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
{
	Global
	Res := DllCall("GetRawInputData", "UInt", lParam, "UInt", RID_INPUT, "Ptr", 0, "UInt *", Size, "UInt", 8 + A_PtrSize * 2)
	VarSetCapacity(Buffer, Size)
	Res := DllCall("GetRawInputData", "UInt", lParam, "UInt", RID_INPUT, "Ptr", &Buffer, "UInt *", Size, "UInt", 8 + A_PtrSize * 2)
	If (NumGet(Buffer, 0 * 4, "UInt") = 1)								
	{
		VKey := NumGet(Buffer, (14 + A_PtrSize * 2), "UShort")
		If (NumGet(Buffer, (16 + A_PtrSize * 2)) = 256)    			
		{
			SetFormat, Integer, H					
			VKey += 0
			If (NumGet(Buffer, 2 * 4, "UInt") = 키보드1) 				
				이쪽(GetKeyName("vk" VKey) "`r`n")
			Else
				저쪽(GetKeyName("vk" VKey) "`r`n")				
		}
	}	
	Return
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
저쪽(Text)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
{
	GuiControlGet, 저쪽이다
	GuiControl,, 저쪽이다, % Text 저쪽이다 
	Return
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
이쪽(Text)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
{
	GuiControlGet, 이쪽이다
	GuiControl,, 이쪽이다, % Text 이쪽이다 
	Return
}

Return to “Ask For Help”

Who is online

Users browsing this forum: clarsondd, Google [Bot], kyuuuri and 256 guests