Enable accents in dvorak layout in WIndows 10

巧了我就是萌 提交于 2019-12-02 17:19:06

问题


I would like to have latin accents using the dvorak layout in windows 10. I have looked to pages like this and this, and I have some layouts. You can see this in the figure below.

Nevertheless, I still can't use latin accents (~, ^). How can I use accents in dvorak layout in Windows 10?


回答1:


You can use AutoHotKey to create a series of dead keys that will allow you to include whatever accents you require. For example, the following script will allow you to use the ~ and n keys to make ñ or Ñ.

~::
Input, key, L1, {delete}{esc}{backspace}
if(key=="n"){
    Send {Asc 164} 
}
else if(key=="N"){
    Send {Asc 165} 
}
else {
    Send {Asc 126}%key%
}
return

The ~:: line grabs the ~ keystroke, then the input command grabs the next 1 character (L1) and assigns it to the variable key. The Delete, Esc,and Backspace keys are all listed as escape keys, which will return just the original ~ that was typed. Otherwise, if you type a lowercase n the script will send the ASCII code for ñ (Send {Asc 130}), and typing an uppercase N sends the ASCII code for Ñ. Typing anything else returns the ~ and the next letter you had typed (the final else command sends the ASCII for ~ followed by the contents of the key variable).

For accents that aren't in the base ASCII, you need to use Unicode, like so:

^::
Input, key, L1, {delete}{esc}{backspace}
if(key=="u"){
    Send {Asc 150} 
}
else if(key=="U"){
    Send {U+00DB} 
}
else {
    Send {Asc 94}%key%
}
return

Note the difference in command when writing the capital Û.

You can chain as many of these together you need, using if ... else if commands for everything that uses the same dead key stroke. Just make sure to include the final else statement and the return command at the end before going on to the next dead key and set of accents. The downside to this is that you need to explicitly spell out all the dead keys and accented characters you want to use. Fortunately, they all follow the same pattern, making setting it up simple, if possibly tedious.


More on the AutoHotKey Send command: https://www.autohotkey.com/docs/commands/Send.htm

More on the AutoHotKey Input command: https://www.autohotkey.com/docs/commands/Input.htm

ASCII table: http://www.asciitable.com/

Unicode table: https://unicode-table.com/en/




回答2:


You can add a compose key: The key to the right of the left shift is not used in dvorak, so can be mapped as a compose key. You can use it to create accented characters. e.g. to make:

  • á type «compose» «a» «'»
  • ö type «compose» «a» «"»
  • ß type «compose» «s» «s»
  • û type «compose» «u» «^»
  • type «compose» «:» «)»
  • type «compose» «-» «>»
  • type «compose» «t» «k»

For Microsoft's windows, you will have to add a compose-key tool, it is not builtin. I can not remember what I used, as I only use MS, when I have to. For Debian Gnu/Linux (and most systems using the X windowing system) , it is built in.



来源:https://stackoverflow.com/questions/46726876/enable-accents-in-dvorak-layout-in-windows-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!