Page 1 of 1

Adding GUI child to another window breaks Ctrl modifiers (temporarily)

Posted: 26 Apr 2024, 13:15
by eugenesv
When holding Ctrl (try in a WordPad)
  • first press C you get regular "Copy" action
  • second press C you get C printed instead
Releasing Ctrl and pressing it again seems to correct the situation
How to avoid breaking it in the first place?

(I'm using this trick to later hide a mouse pointer in the window owner)

Code: Select all

#Requires AutoHotKey 2.0
#Warn All, Off
~^c::{
  ctrl_hider() ;
}
ctrl_hider(OnOff := '', is🖰vis := '') { ;
  static guiBlankChild := Gui() ;
  guiBlankChild.Opt("+Owner" . WinGetID("A")) ;
}