问题
I am trying to understand this bug and I am looking for a workaroud.
Using this script:
#NoEnv
#SingleInstance force
SendMode Input
;Alt+t to send keystrokes
!t::Send, /[]
It send the correct keystrokes /[] to all windows but the windows console (cmd)
Additional Info:
- Using autohotkey v1.1.09.02
- With an english US keyboard layout, it sends: '90
- With a french canadian multilingual keyboard layout, it sends: é^ç
Any idea of what can fix it?
回答1:
Try this:
#NoEnv
#SingleInstance force
;SendMode Input
;Alt+t to send keystrokes
!t::Send, % chr(047) chr(091) chr(093)
Return
And let me know if it solves your issues.
Found this:
I use multiple languages or keyboard layouts on my system. Why do Send and Hotstrings sometimes send the wrong characters?
This can happen whenever the script's language or keyboard layout does not match that of the active window. To fix it, open the script's main window via its tray icon. While the main window is active, use the language bar (or a language hotkey such as LeftAlt+Shift) to change the script's language/layout to match that of the window you are currently typing in. Switching the script's language can be automated with the following example hotkey:
#l:: ; Win+L hotkey.
ListLines ; Show the script's main window.
WinWaitActive ahk_class AutoHotkey
Send {LAlt down}{Shift}{LAlt up} ; Switch to alternate language (keys must be in this format).
WinMinimize ; Minimize the window found by WinWaitActive above.
return
More info: Like all applications, each script starts off using your default language. If the default does not match that of the active window (where the keystrokes are sent), the difference in keyboard layouts might cause keystrokes sent by the script to be translated into something unexpected.
On: http://autohotkey.free.fr/docs/FAQ.htm#load
来源:https://stackoverflow.com/questions/15882714/autohotkey-wrong-keystrokes-sent-to-console