neovars: unicode keypress replaced with native send

Notes:
- "SendUnicodeChar(charCode)" can be replaced by send % {Chr(charCode)}
  since AHK 1.1.27; this should produce similar results
  (compare with SendUnicodeChar in  522e83eee0/source/keyboard_mouse.cpp (L91))
- however "up", "down" events cannot be replaced similarly for most keys
  (see also https://www.autohotkey.com/docs/commands/Send.htm)
This commit is contained in:
ferdinym 2020-11-02 08:04:05 +01:00
parent 33d6dfbc87
commit ebcc37d068
1 changed files with 13 additions and 2 deletions

View File

@ -3,6 +3,7 @@
; Global neovars objects
Comp := composeDict ; current compose-plane
; Hotkey activation event handler (all modifiers)
;
; keyName
@ -172,8 +173,11 @@ CharOut(char) {
SendBlindShiftFixed(char, DNCS%char% . UPCS%char%)
else if (CS%char% != "")
SendBlindShiftFixed(char, "{" . CS%char% . "}")
else
SendUnicodeChar("0x" . SubStr(char,2))
else {
;SendUnicodeChar("0x" . SubStr(char,2))
charOrd := "0x" . SubStr(char,2) ; should be equivalent
send % "{" . Chr(charOrd) . "}" ;
}
}
; Send out activation event "key down"
@ -241,6 +245,13 @@ SendBlindShiftFixed(char, theseq) {
; Unicode output
;
; Notes:
; - "SendUnicodeChar(charCode)" can be replaced by send % {Chr(charCode)}
; since AHK 1.1.27; this should produce similar results
; (compare with SendUnicodeChar in https://github.com/Lexikos/AutoHotkey_L/blob/522e83eee0287cf02388aff179b3fcb6da33d268/source/keyboard_mouse.cpp#L91)
; - however "up", "down" events cannot be replaced similarly for most keys
; (see also https://www.autohotkey.com/docs/commands/Send.htm)
SendUnicodeChar(charCode){
static ki := "#"
if (ki =="#") {