重要历史

重要历史

我想使用HenkanKanaHira键切换输入语言,这些都是日语键盘实现的。

    vk1Csc079::
      PostMessage, 0x50, 0, 0x41E041E,, A ; 0x50 is WM_INPUTLANGCHANGEREQUEST
    Return

    vkF2sc070::
      PostMessage, 0x50, 0, 0x4110411,, A ; 0x50 is WM_INPUTLANGCHANGEREQUEST
    Return

vk1Csc079是 的代码Henkan,是vkF2sc070KanaHira代码。使用此代码,我可以将键盘上的日语改为泰语,但无法将泰语反过来改为日语。

我注意到,因为泰语中有另一个键映射,所以KanaHira切换后就不再存在了。

所以我想知道我应该为该功能写什么键码才能在泰语键盘中启用它。有人知道吗?

重要历史

Window: C:\Users\ironsand\Desktop\thai_keyboard.ahk - AutoHotkey v1.1.23.05
Keybd hook: no
Mouse hook: no
Enabled Timers: 0 of 0 ()
Interrupted threads: 0
Paused threads: 0 of 0 (0 layers)
Modifiers (GetKeyState() now) = 
Modifiers (Hook's Logical) = 
Modifiers (Hook's Physical) = 
Prefix key is down: no

NOTE: Only the script's own keyboard events are shown
(not the user's), because the keyboard hook isn't installed.

NOTE: To disable the key history shown below, add the line "#KeyHistory 0" anywhere in the script.  The same method can be used to change the size of the history buffer.  For example: #KeyHistory 100  (Default is 40, Max is 500)

The oldest are listed first.  VK=Virtual Key, SC=Scan Code, Elapsed=Seconds since the previous event.  Types: h=Hook Hotkey, s=Suppressed (blocked), i=Ignored because it was generated by an AHK script, a=Artificial, #=Disabled via #IfWinActive/Exist, U=Unicode character (SendInput).

VK  SC  Type    Up/Dn   Elapsed Key     Window
-------------------------------------------------------------------------------------------------------------
Press [F5] to refresh.

答案1

有些函数会强制安装键盘钩子,而有些则不会。您的脚本没有强制安装键盘钩子,因此它不是全局运行/可用的

注意你的日志文件的顶部...键盘挂钩=否....

Window: C:\Users\ironsand\Desktop\thai_keyboard.ahk - AutoHotkey v1.1.23.05
Keybd hook: no
Mouse hook: no
Enabled Timers: 0 of 0 ()

第二条注释...

NOTE: Only the script's own keyboard events are shown
(not the user's), because the keyboard hook isn't installed.

为了强制使用键盘钩子并查看所有按键的击键,您应该能够在脚本顶部添加#InstallKeybdHook或指令。执行此操作后,您应该能够转到按键历史记录并查看键盘钩子已启用。#UseHook On

一旦启用了键盘钩子,并且打开了按键历史记录窗口,按下需要获取按键历史记录的按键。但是,直到您按下 ,它才会出现在窗口中F5,正如@harrymc 所指出的那样。

写完这篇文章后,我看到评论越来越多,而且你已经弄清楚了这一切。我打算以任何方式发布,以方便其他人。

相关内容