View Single Post
  #19  
Old 12-19-2017, 11:41 AM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 896
POST ID # = 931165
hastegag Reputation: 20
Default only on release keypress?

If anybody cares, my code was bad as posted and linked above...down and up events were both triggering the fake keypress.

That said, there were two ways to fix, one you could do this hacky thing in AHK:
Code:
global ultraProfile:=0
global noRepeat:=1
SC0C1::
	;MsgBox G1
	if(ultraProfile && !noRepeat){
		Send, stuff
		noRepeat:=!noRepeat
		Sleep,500
	}
	noRepeat:=!noRepeat
Return
SC0EA::
	;MsgBox M10
	ultraProfile:=1
	noRepeat:=0
return
or better yet what appears to work is also check for the boolean in register_callback with the short circuit AND with the keyId (which is also better i assume than my earlier posted character string comparison)
Code:
		if(keyId == CorsairKeyKb_G1 && pressed)
		{
			keybd_event(VK_KANA, 0xC1, 0, 0);
		}
and so on

Last edited by hastegag; 12-21-2017 at 04:06 PM. Reason: typo