 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
rogal
Joined: 23 Dec 2007 Posts: 51 Location: Austin
|
Posted: Sun Dec 30, 2007 8:51 am Post subject: Compatible Hotkeys in Colemak & Dvorak Layout |
|
|
First of all, you can switch between layouts easily with the following great script.
http://www.autohotkey.com/forum/viewtopic.php?t=27029
Then you can recognize which layout is in effect by using the following function:
| Code: | key_layout()
{
WinGet, Active_Window_ID, ID, A
Active_Window_Thread := DllCall("GetWindowThreadProcessId"
, "UInt", Active_Window_ID, "UInt", 0)
return DllCall("GetKeyboardLayout", "UInt", Active_Window_Thread)
}
|
then, you can define hotkeys accordingly:
| Code: | Lay_Colemak := -255851511
#UseHook On
^r::
Lang_In_Window := lang_layout()
if (Lang_In_Window=Lay_Colemak)
send, ^s
Else
send, ^r
return
;The same function as above
key_layout()
{
WinGet, Active_Window_ID, ID, A
Active_Window_Thread := DllCall("GetWindowThreadProcessId"
, "UInt", Active_Window_ID, "UInt", 0)
return DllCall("GetKeyboardLayout", "UInt", Active_Window_Thread)
}
|
In Colemak layout, s becomes r, so the above example will send ^s when you press ^r in Colemak.
PS: Changing layout is superior to remapping all keys since if you remap keys, hotstrings will not work. |
|
| Back to top |
|
 |
TheLeO
Joined: 11 Jun 2005 Posts: 160 Location: England ish
|
Posted: Mon Mar 10, 2008 1:07 pm Post subject: |
|
|
thanks for the idea, i'll give it a try...
by the way, I just found out about colemak, do you know whats the fastest/easiest/mosy fun way to learn it? _________________ And i say: where there is a problem , there is a solution.(well some where that is.)
::
I Have Spoken
:: |
|
| Back to top |
|
 |
rogal
Joined: 23 Dec 2007 Posts: 51 Location: Austin
|
Posted: Mon Mar 10, 2008 3:47 pm Post subject: |
|
|
TheLeO, I have already sent you a message .
Actually I don't use the hotkey thing anymore. I have found much better way to preserve all the hotkeys.
If you modify Colemak layout and make the VK values be the same with QWERTY, then the all the hotkeys will be preserved. (since if you press a key with modifier such as CTRL, the VK values is sent).
In order to do that, you have to directly edit the Colemak layout source file with text editor, and copy/paste QWERTY VK values, since you cannot change VK values with Microsoft Keyboard Layout Creator 1.4.
Finally, in order to preserve windows key hotkeys, you have to boot with QWERTY as standard, and then change to Colemak. The VK value trick does not work with windows key. I made a AHK code to switch(toggle) to Colemak so when I press Shift + space my keyboard layout is switched to colemak. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|