Does anyone know the API call I can use to change the keyboard layout on a windows machine to Dvorak? Doing it through the UI is easy but I'd like to have a script that I can run on new VM's to automate the process.
+5
A:
You can do this via the registry. Just save it as a .reg file, and open it on the new VM. I believe this should do it for remapping to Dvorak:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"ScanCode Map"=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,28,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,27,00,2c,00,00,\
00,00,00
And if you want to go back:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"ScanCode Map"=hex:00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00
pkaeding
2008-10-03 14:07:46
I looked at the registry on my machine (Vista) where I have Dvorak setup and I didn't see any of these entries.
JaredPar
2008-10-03 14:58:45
Yes, probably selecting the layout in the UI sets some other flag. This method will remap the keyboard, without changing the layout. Its a strange distinction, but I think it explains the difference.
pkaeding
2008-10-03 15:19:30
A:
I decided to find all the posts regarding Dvorak and add this little bit of insight from Reason magazine regarding the Dvorak keyboard:
http://www.reason.com/news/show/29944.html
Summary: Dvorak is to keyboards what Linus Pauling is to Vitamin C (no one could reproduce his results) and the whole "QWERTY is set up to reduce typing speed" is false.
jcollum
2008-12-18 19:28:27
Yes/no on the speed. I've been meaning to write a full blog post on this but here is the summary. Dvorak is faster at peak speed (140 vs. 120). But in reality once you can average close to 100 WPM much more isn't really adding a benefit.
JaredPar
2008-12-19 07:29:09
But I stick with Dvorak now because qwerty was starting to cause Carpal tunnel. Is Dvorak more ergonomic or is just the switch that helped out. Frankly, I don't really know or care but for the moment Dvorak feels better so I stick with it. Moment somehow dragged on to 4 years now though.
JaredPar
2008-12-19 07:30:49
This is mostly subjective data and thus meaningless for a real study. Bottom line is it works for me so I stick with it. I typically advise people from switching to Dvorak though because I don't think the limited gains are necessarily worth the effort of switching.
JaredPar
2008-12-19 07:32:20
I put this answer in because I think there's an urban legend out there that dvorak is somehow superior. It answers the question that the OP should've asked instead: Is Dvorak superior to Qwerty? Despite the downvotes I'm leaving the answer here.
jcollum
2009-12-14 20:54:30