This question is originally posted by me in Microsoft Community at:
In summary: I have created a custom keyboard layout with Microsoft Keyboard Layout Creator 1.4 in Windows 10, it is working but only partially. It cannot:
combine two keystrokes into one to type a "combined letter", e.g, "¨"+"u" = "ü". It should not exist in Chinese but I want to achieve this.
type Chinese pinyin and Chinese punctuation. In MS pinyin IME, I can press shift to switch between Chinese pinyin mode and English mode. Under pinyin mode I can convert letters into pinyin and thus get Chinese characters, but my layout lacks this. And, if I press "," in Microsoft Pinyin in pinyin mode, it should give me ","(full length comma), but this layout is not able to do this.
I am thinking about two ways to solve this:
Substitute Microsoft Pinyin's keyboard layout to my layout(replace the English part of MS Pinyin with my layout)
Copy the pinyin part of MS pinyin to my layout.
So, how can I solve this?
I have solved it.
For the first problem, you must define some "dead keys combinations". The details are explained here:
http://www.angelfire.com/planet/linguisticsisfun/Creating_a_Keyboard_Using_MSKLC.pdf
For the second problem, basically you do:
Create your keyboard layout.
Edit the .klc
file with a Text Editor, to change the VK code mapping. That is because most of the applications in Microsoft Windows, when you press the hotkeys, detects VK code sent to OS, not the "key chars"(the characters output as you type in a text processing software). So in order to make the key chars of your keyboard layout to match with their VK code, you must do this manually. MSKLC will not change that for you. Some details here:
http://www.sensefulsolutions.com/2010/08/how-to-fix-keyboard-shortcuts-in-klc-eg.html
Install the layout.
Open your registry editor, enter HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\
, find your new keyboard layout at the bottom (mine with name like a0000xxxx
). Copy the dll
file name. That is the DLL file containing your newly created keyboard layout info.
Go back to the registry father branch, search the language you want to apply this layout, like Chinese or Spanish. You will find several variations with names alike, but the descriptions are self-explanatory and can help you differentiate them.
Simplified Chinese uses KBDUS.dll
, that means "keyboard layout for US keyboard". This will apply to MS Pinyin, too. Change this value to your copied DLL name, so that it will load your DLL next time the OS launches.
Restart.
The result:
,
and .
.ï
, á
, ç
, ñ
and €
without switching to Spanish keyboard.