Customize Dvorak keyboard layout under Windows

Windows下自定义Dvorak键盘布局

After several twists and turns, I finally sorted out the Dvorak layout in Windows (though with some modifications).
Let’s start with the layout diagram of Dvorak.

Unlike QWERTY, Dvorak distributes the most commonly used keys in the middle row, minimizing hand movement compared to the exaggerated piano-like motion of QWERTY.
Here is a description of QWERTY (excerpted from Wikipedia):

“QWERTY” is the sequence of the first six letters in the upper left corner of the keyboard.
The principle behind the arrangement of QWERTY keys is to reduce the chances of jamming and malfunctioning in typewriters by separating frequently used letters (although letters like “E” and “R” are adjacent).

Currently, 99% of input devices do not jam, but because QWERTY is so widely used, it continues to be retained. This is also the reason for writing this article, which is to create change.

Okay, now to the main topic. The i-rocks keyboard I am currently using is shown in the image below:

To change to a Dvorak keyboard layout, the first step is to remove the keycaps and replace them with those of the Dvorak layout.
Replacing the keycaps and cleaning took half an hour, resulting in the following:

OK, done. But this was just the simplest step; there’s also software configuration to handle.

Layout modification plan for Windows

Using AutoHotKey for mapping

I won’t go into detail about AutoHotKey here, just the script.
Here it is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Suspend  
F12::Suspend
1::[
2::7
3::5
4::3
5::1
6::9
7::0
8::2
9::4
0::6
-::8
=::]
q::/
w::,
e::.
r::p
t::y
y::f
u::g
i::c
o::r
p::l
[::'
]::=
;a::a
s::o
d::e
f::u
g::i
h::d
j::h
k::t
l::n
`;::s
'::-
z::`;
x::q
c::j
v::k
b::x
n::b
;m::m
,::w
.::v
/::z
```

After installing AutoHotKey, save the above code as *.ahk and run it.
>This script's default state is Suspend (off), and pressing F12 toggles it on/off. (This is also common for laptop keyboards.)

#### Modifying registry key values
Actually, Windows itself has a Dvorak layout: Control Panel - Clock, Language, and Region - Region and Language - Change keyboards or other input methods - Keyboard and Languages - Change keyboards - Add (as shown below):
![](https://img.imzlp.com/imgs/zlp/blog/posts/50343/dvorak-3.webp)
However, having only these few options is a bit unsatisfactory (because I modified a few keys based on my habits), and the critical issue is that Sogou Pinyin does not support the Dvorak layout. Although I can touch type, it still feels strange to use QWERTY with a Dvorak layout, which led me to seek keyboard mapping methods. Initially, I found a "Key Value Mapping Table" (as shown below):
![](https://img.imzlp.com/imgs/zlp/blog/posts/50343/dvorak-2.webp)
This is just part of it (there are too many byte codes, so I only posted a portion).

Then I calculated the key movement method. I initially wanted to create a mind map to assist with key mapping, but it turned out to be too convoluted.
Like this:

;>Q>X>B>N>L>P>R>O… Until all key values were mapped, it took a lot of effort, and I almost got confused.

1
2
3
4
5
6
7
The method for altering key mappings is as follows:  
> Example: Changing the Caps Lock key (byte code: 3A 00) to the left Ctrl key (byte code: 1D 00), would be written as: 1D 00 3A 00

This made things easier (not at all easy really; during this process, I mischanged a code causing 'S' and '-' to swap places, making typing very frustrating).
Without further ado, here’s the final code:

Key modification version:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\KeyboardLayout]
“ScanCodeMap”=hex:00,00,00,00,00,00,00,00,22,00,00,00,2d,00,30,00,24,00,2e,00,\
11,00,33,00,33,00,11,00,12,00,20,00,34,00,12,00,1b,00,0d,00,0d,00,1b,00,16,\
00,21,00,17,00,22,00,20,00,23,00,1a,00,0c,00,2e,00,17,00,23,00,24,00,14,00,\
25,00,31,00,26,00,35,00,1a,00,30,00,31,00,13,00,18,00,26,00,19,00,2f,00,34,\
00,27,00,10,00,0c,00,28,00,19,00,13,00,18,00,1f,00,1f,00,27,00,2c,00,35,00,\
15,00,14,00,22,00,16,00,25,00,2f,00,10,00,2d,00,21,00,15,00,28,00,2c,00,00,\
00,00,00

1
2
3
Save it as *.reg and run it then log off (those who are too curious should not try randomly, or you might suddenly become very slow at typing). Also, the modified key positions are not standard Dvorak Classics key positions; the difference is that the positions of ' and ; have been swapped.  

However, I also wrote a reset script (this is indeed much simpler). Here it is:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\KeyboardLayout]
“ScanCodeMap”=hex:00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00

Likewise, save it as *.reg and run it then log off.  

>This method of modifying the layout has the biggest drawback that if you want to switch back to QWERTY layout, you can only run the reset script above and then log off. If you want to switch seamlessly between two layouts, I strongly recommend using the AutoHotKey version.  

<p align="right">2014.12.22  
<p align="right">Written in Dvorak  

#### My Experience After Using the Dvorak Layout for a Few Months  
Since I started using the Dvorak Classics layout for a few months (of course, in the computer lab I still inevitably have to use the QWERTY layout), the experience has been excellent. The most immediate change is that typing has become a very enjoyable task; there’s no need for my hands to move around like playing the piano—only my fingers are moving, which feels fantastic, and I can basically touch type without any pressure. As for whether it affects my typing feel on QWERTY, that is definitely the case. I remember when I first started using the Dvorak layout, I became so accustomed to it that I forgot the QWERTY layout, and typing became quite slow (though it wasn’t really forgotten; it was just that temporarily my fingertips’ memory of the Dvorak layout had imprinted in my mind, while the conflicting QWERTY layout’s “fingertip memory” was temporarily forgotten). At that time, I was worried that if I fell into the trap of not being able to switch back, it would be a big loss. However, even after using Dvorak for such a long time, I can still touch type on QWERTY without any pressure (some Dvorak high-frequency keys still feel a bit awkward due to fingertip memory). Perhaps the longer I’ve used it, the clearer my memory becomes (fingertip memory + deep memory).  

I initially had significant doubts about practicing this layout, especially fearing the trap of not being able to switch back, and almost interrupted several times. However, I kept thinking, “Keep doing what you believe is right.” It became a sort of encouragement for myself. Honestly, this period has also been a difficult choice period, because once I made the choice, many things became easier to manage.  

<p align="right">2014.05.10  
<p align="right">Written in Dvorak Classics  
The article is finished. If you have any questions, please comment and communicate.

Scan the QR code on WeChat and follow me.

Title:Customize Dvorak keyboard layout under Windows
Author:LIPENGZHA
Publish Date:2015/08/19 11:01
Word Count:3.9k Words
Link:https://en.imzlp.com/posts/50343/
License: CC BY-NC-SA 4.0
Reprinting of the full article is prohibited.
Your donation will encourage me to keep creating!