For Japanese (JIS) keyboard users (some Key codes have been shortened)

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: For Japanese (JIS) keyboard users (some Key codes have been shortened)

Re: For Japanese (JIS) keyboard users (some Key codes have been shortened)

Post by timtak » 08 Jul 2018, 21:10

I want to turn off Japanese input IME software before my autohotkey command and then turn it back on again so I added

Send {vkF3}
Script....
Send {vkF4}

And I think that works, thank you. I am not sure why it should be needed but unless I turn off IME then the character strings that I "send" are sent as Japanese characters even though I have half-space western characters specified inside the script.

I guess perhaps autohotkey is not exactly sending the defined string so much as tapping the keyboard for me, maybe. Strange.

The trouble with the above is that if I am in Japanese language mode then it is going to take me out of it every time I use a autohotkey script.

HOLD ON. I have those in the on and off in the wrong order. <i>But it is working</i>. And It does not turn off my Japanese IME after the script. It does just what I want it to do!

More detail.

I have couple of scripts for adding html <i>italics</i> and <b>bold</b>

I have added the
Send {vkF3}
Script....
Send {vkF4}
into my itallic script so that it now looks like this

!i::
Sleep, 100
clipsave := clipboard
Send ^c
Sleep, 50
Send {vkF3}
clipitalic := "<i>" . clipboard . "</i>"
SendInput {Raw}%clipitalic%
clipboard := clipsave
clipitalic =;
Send {vkF4}
Return

Whereas my bold script is as yet unchanged.

!b::
Sleep, 100 clipsave := clipboard
Send ^c
Sleep, 50
clipstrong := "<b>" . clipboard . "</b>"
SendInput {Raw}%clipstrong%
clipboard := clipsave
clipstrong =;
Return

Now, if I go into Japanese and <i>use the former</i>, the script works fine, and my IME is left on. However, if I go into Japanese and use the latter on <b>あランドmstりんg<・b> (which said "a random string") then as you can see it does not work at all, pasting Japanese characters (or typing them for me!) instead.

Well, it works, by chance, and I am grateful. Thank you.

Re: For Japanese (JIS) keyboard users (some Key codes have been shortened)

Post by neokix » 30 Jan 2018, 03:38

Thank you for replying, Lexikos.
I truly appreciate what you are creating.
If you are, please don't get me wrong. I am not criticising anyone or any changes that you or others make. Simply informing people who have Japanese layout keyboards.

One thing you might need to know about my previous post is, Japanese ahk wiki isn't perfect.
As far as I know, all of Japanese websites that mention about special keys in Japanese keyboards are saying "This special key (eg. Muhenkan-key) corresponds to vkXXscnnn" since 2014, and describe no further about what is vk, nor sc.
And all wikis are locked by previous admins who abandoned the wiki, and I have no way contacting them.
So it is natural (for Japanese speakers at least) to consider vkXXscNNN as the proper way of using those keys.

And as you might know, people who just started using ahk to remap those keys usually don't know how to use #InstallKeybdhook or any other convenient functions.
That's why I wrote it in the first place at this forum, to inform in more specific and casual way.

By the way, your change actually changed my vision about how vk and sc work, so yes, your intention worked with your explanation.
But it is also true that some people who are using AutoHotkey without much knowledge of English language actually got confused by sudden "unloadable error", which is quite upsetting, as you can also imagine.

But again, here, I am not criticising anyone or any changes that you or others make. Simply informing.

Sorry about this rather long post. I hope this reaches you.

Re: For Japanese (JIS) keyboard users (some Key codes have been shortened)

Post by lexikos » 16 Jan 2018, 04:12

That change made my script even unloadable once (but it was solved by removing SCnnn).
That is because your script contained an undetected error: SCnnn. Writing vk1Dsc123:: (or whatever sc number) was the same as writing vk1Dthisisnotvalid:: (except that if you wrote both, they were not considered duplicates, and only one would work).

My intention in making the script "unloadable" was to alert the user (such as yourself) to the error in the script and hopefully correct any misunderstandings about its use (e.g. the misbelief that the suffix had some effect, that it was necessary, or that the hotkey would only fire if the scan code matched what was specified).

Re: For Japanese (JIS) keyboard users (some Key codes have been shortened)

Post by neokix » 27 Dec 2017, 06:24

Hi, gregster! Thanks for the reply.

That change made my script even unloadable once (but it was solved by removing SCnnn).

I'm not really sure how those key codes works, but since using those keys as simple remapping, longer version used to work just fine.
But omitted(?) version is easy to remember and type, so no complain there.
Just need to remove/replace some codes, I guess. Surprising first, but welcomed.

Re: For Japanese (JIS) keyboard users (some Key codes have been shortened)

Post by gregster » 26 Dec 2017, 22:21

I assume it has to do with "Scripts containing hotkeys of the form VKnnSCnnn:: will need to be corrected by removing SCnnn, which was previously ignored." (compare https://autohotkey.com/boards/viewtopic ... 97#p190697)

In that case, the vk codes above would have already worked before, but the "long version" was understood just the same. But it contained a syntax error that was ignored before (but could lead to problems in some cases). At least that is my understanding of the changes. Of course, I don't even know how your script looked before.

For Japanese (JIS) keyboard users (some Key codes have been shortened)

Post by neokix » 26 Dec 2017, 21:25

I'm posting this for the sake of informing/warning JIS keyboard users for recent changes of keycodes, that is very critical to the use of AutoHotkey.
Because I was like "what? why my script not working? " and then after reading those change logs, I became "AHA!"

Yes, I should have posted this somewhere else or other forums, but since not many people use AutoHotkey in Japan and it's the only place that people can reach so please forgive me. Well, the Japanese wiki owners locked normal users away since 2013! so...

After the build 1.1.27.00 (latest for now), the keycode for JIS keyboards (and I suppose others ) have been altered (shortened).
Now, don't have to remember all the letters that come after vk. Just vk codes are required.

Hence,

Code: Select all

Muhenkan / 無変換 -> {vk1D}
Henkan / 変換 -> {vk1C}
Kana / かな -> {vkF2}
IME ON/OF -> {vkF3}, {vkF4}
Oh, and if you are interested in keyboard overseas, JIS keyboards have extra 4 keys! lol
With AutoHotkey, I am very happy using them, since those keys are in good position, but not really useful in vanila Windows.

For Japanese speakers I repeat myself in Japanese a bit.
*ビルド1.1.27.00以降,上のようにキーコードが変更になりました.ご注意ください.

Top