@@ -90,8 +90,8 @@ void DisguiseWinAltIfNeeded(vk_type aVK, bool aInBlindMode)
90
90
}
91
91
92
92
93
-
94
- void SendKeys (char *aKeys, bool aSendRaw, SendModes aSendModeOrig, HWND aTargetWindow)
93
+ void SendKeys ( char *aKeys, bool aSendRaw, SendModes aSendModeOrig, HWND aTargetWindow, unsigned int sendahk) // N11
94
+ // void SendKeys(char *aKeys, bool aSendRaw, SendModes aSendModeOrig, HWND aTargetWindow)
95
95
// The aKeys string must be modifiable (not constant), since for performance reasons,
96
96
// it's allowed to be temporarily altered by this function. mThisHotkeyModifiersLR, if non-zero,
97
97
// shoul be the set of modifiers used to trigger the hotkey that called the subroutine
@@ -549,7 +549,11 @@ void SendKeys(char *aKeys, bool aSendRaw, SendModes aSendModeOrig, HWND aTargetW
549
549
// Don't tell it to save & restore modifiers because special keys like this one
550
550
// should have maximum flexibility (i.e. nothing extra should be done so that the
551
551
// user can have more control):
552
- KeyEvent (event_type, vk, 0 , aTargetWindow, true );
552
+ if (sendahk) // N11 inject keys not ignored by ahk
553
+ KeyEvent (event_type, vk, 0 , aTargetWindow, true , KEY_NOIGNORE);
554
+ else
555
+ KeyEvent (event_type, vk, 0 , aTargetWindow, true );
556
+ // N11
553
557
if (!sSendMode )
554
558
LONG_OPERATION_UPDATE_FOR_SENDKEYS
555
559
}
@@ -586,9 +590,17 @@ void SendKeys(char *aKeys, bool aSendRaw, SendModes aSendModeOrig, HWND aTargetW
586
590
// value for modifiers.
587
591
single_char_string[0 ] = *aKeys; // String was pre-terminated earlier.
588
592
if (vk = TextToVK (single_char_string, &mods_for_next_key, true , true , sTargetKeybdLayout ))
589
- // TextToVK() takes no measurable time compared to the amount of time SendKey takes.
590
- SendKey (vk, 0 , mods_for_next_key, persistent_modifiers_for_this_SendKeys, 1 , KEYDOWNANDUP
591
- , 0 , aTargetWindow);
593
+ // TextToVK() takes no measurable time compared to the amount of time SendKey takes.
594
+ // ahkx N11 sendahk
595
+ {
596
+ if (!sendahk)
597
+ SendKey (vk, 0 , mods_for_next_key, persistent_modifiers_for_this_SendKeys, 1 , KEYDOWNANDUP
598
+ , 0 , aTargetWindow);
599
+ else
600
+ SendKey (vk, 0 , mods_for_next_key, persistent_modifiers_for_this_SendKeys, 1 , KEYDOWNANDUP
601
+ , 0 , aTargetWindow, COORD_UNSPECIFIED, COORD_UNSPECIFIED, false , KEY_NOIGNORE);
602
+
603
+ } // N11
592
604
else // Try to send it by alternate means.
593
605
{
594
606
// v1.0.40: SendKeySpecial sends only keybd_event keystrokes, not ControlSend style keystrokes:
@@ -779,7 +791,7 @@ void SendKeys(char *aKeys, bool aSendRaw, SendModes aSendModeOrig, HWND aTargetW
779
791
780
792
void SendKey (vk_type aVK, sc_type aSC, modLR_type aModifiersLR, modLR_type aModifiersLRPersistent
781
793
, int aRepeatCount, KeyEventTypes aEventType, modLR_type aKeyAsModifiersLR, HWND aTargetWindow
782
- , int aX, int aY, bool aMoveOffset)
794
+ , int aX, int aY, bool aMoveOffset, unsigned int sendahk) // ahkx N11 added sendahk
783
795
// Caller has ensured that: 1) vk or sc may be zero, but not both; 2) aRepeatCount > 0.
784
796
// This function is reponsible for first setting the correct state of the modifier keys
785
797
// (as specified by the caller) before sending the key. After sending, it should put the
@@ -863,7 +875,13 @@ void SendKey(vk_type aVK, sc_type aSC, modLR_type aModifiersLR, modLR_type aModi
863
875
else
864
876
// Sending mouse clicks via ControlSend is not supported, so in that case fall back to the
865
877
// old method of sending the VK directly (which probably has no effect 99% of the time):
866
- KeyEvent (aEventType, aVK, aSC, aTargetWindow, true );
878
+ { // ahkx N11 send events not ignored by ahk
879
+ if (!sendahk)
880
+ KeyEvent (aEventType, aVK, aSC, aTargetWindow, true );
881
+ else
882
+ KeyEvent (aEventType, aVK, aSC, aTargetWindow, true , sendahk);
883
+ } // N11
884
+
867
885
} // for() [aRepeatCount]
868
886
869
887
// The final iteration by the above loop does a key or mouse delay (KeyEvent and MouseClick do it internally)
0 commit comments