Skip to content

Commit

Permalink
Fix faulty multiple "i" key presses on my K70 RGB take #2.
Browse files Browse the repository at this point in the history
Since the original hotkey was blocking the keyboard "i" key and sending a "fake i", all hotstrings using the "i" were broken.

With @CloakerSmoker#2459 maybe this is fixed now.
  • Loading branch information
TheBestPessimist committed Jul 13, 2019
1 parent 4b08e58 commit 02fefcd
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions AutoHotkeyU64.ahk
Expand Up @@ -111,13 +111,30 @@ CapsLock & P::TogglePowerScheme()
; When pressed once, it may register 1, none, or even 3 presses.
; Kinda annoying, yes.
;
; Ref: http://leo.steamr.com/2012/08/fixing-mouse-buttonwheel-from-unintended-double-clicking/

$*i::
If (A_TimeSincePriorHotkey < 90 && A_TimeSincePriorHotkey > 1) {
Tippy("i doublePress " . A_Now)
Return
}
Send % "{Blind}i" ; use Blind mode so that Shift and CapsLock work
;
; The commented hotkey below is the legacy way which even if works, has the issue that it breaks all hotstrings containing "i"
; since keyboard "i" is blocked, and ahk sends a "fake i"
; $*i::
; If (A_TimeSincePriorHotkey < 90 && A_TimeSincePriorHotkey > 1) {
; Tippy("i doublePress " . A_Now)
; Return
; }
; Send % "{Blind}i" ; use Blind mode so that Shift and CapsLock work
; Return
;
;
; This is a suggestion from @CloakerSmoker#2459 on the ahk discord: https://discord.gg/eKEX7AG
;
; Bind "i" key to nothing (`~*i::Return`), just so that A_TimeSincePriorHotkey updates and don't block the key on a normal press.
; Otherwise if it was a double press, show the tooltip and block the OS from getting the key press
; By using #if we have the original key presses getting sent, instead of AHK sending them
; which should fix hotstrings/hotkeys that were messing up

#if (A_TimeSincePriorHotkey < 90 && A_TimeSincePriorHotkey > 1)
*i::
Tippy("Double press at " A_Now)
Return
#if

~*i::Return

0 comments on commit 02fefcd

Please sign in to comment.