1
0
I want to switch input languages by using Henkan
and KanaHira
keys, these are implemented Japanese keyboard.
vk1Csc079::
PostMessage, 0x50, 0, 0x41E041E,, A ; 0x50 is WM_INPUTLANGCHANGEREQUEST
Return
vkF2sc070::
PostMessage, 0x50, 0, 0x4110411,, A ; 0x50 is WM_INPUTLANGCHANGEREQUEST
Return
vk1Csc079
is code for Henkan
and vkF2sc070
is for KanaHira
.
With this code I could change keyboard Japanese to Thai, but I couldn't change Thai to Japanese backwards.
I noticed that because in Thai there are another key mapping so the KanaHira
doesn't exist anymore after switching.
So I want to know what key code should I write for the function to enable it in Thai keyboard. Does anyone know about it?
Key Histories
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.
After you switch the keyboard to Thai, can you start AutoHotkey, right-click the tray icon > Open > View > Key History, press the physical key that would normally map to
KanaHira
, then refresh in order to see the VK that now corresponds to that key? If so, you could replacevkF2sc070
with the key code generated from the same physical key in the Thai layout – JJohnston2 – 2016-05-18T03:04:41.233I tried that but the
key history and script info
doesn't show me the key code. Am I doing something wrong? – ironsand – 2016-05-18T08:30:18.590You can define a hotkey for switching keyboards via Control Panel / Region and Language / Keyboards and Languages / Change keyboards / Advanced key settings. However, the hotkeys permitted here are of limited variety. – harrymc – 2016-05-19T10:08:17.563
@harrymc yeah, that's the reason I want to change it by
Auto hotkey
. – ironsand – 2016-05-19T10:54:14.453For the comment by @JJohnston2 : Did you press F5 after pressing the key ? – harrymc – 2016-05-19T11:06:14.433
Yes, and I also tried from menu item. – ironsand – 2016-05-19T12:00:54.493
If you can see normal keys in Key History, but not this key, then I think it might be unusable in AutoHotkey. – harrymc – 2016-05-19T15:07:29.880
@harrymc I couldn't get normal key neither and I found out that I must add
#InstallKeybdHook
to get key history. Finally I got the code of the keyvkFFsc070
. Thanks!! – ironsand – 2016-05-20T19:05:24.760@JJohnston2: You should answer this post with more details. – harrymc – 2016-05-20T19:09:14.063