• You are not logged in.
  • Index
  • Technical
  • Reverse PKL (colemak to qwerty) for colleague's sake

    Reverse PKL (colemak to qwerty) for colleague's sake

    • Started by mattme
    • 10 Replies:
    • Reputation: 0
    • Registered: 18-Jun-2013
    • Posts: 6

    Hi all. I have Colemak set as my Windows keyboard layout (found it more reliable than PKL). Sometimes my colleague would like to help me at my computer, but he can't type Colemak. Is there anyway I can use PKL to map Colemak to Qwerty? I'd keep it disabled normally, but turn it on when my colleague sits at the keyboard.

    https://i.imgur.com/XzX5in6.png

    Last edited by mattme (18-Jun-2013 23:32:14)
    Offline
    • 0
    • Reputation: 210
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,343

    Yes. You can't use the VirtualKey layouts because they just plop the scan code over to the Windows layout which in your case is Colemak. But you *can* use a QWERTY-mapped layout. There aren't any such available, so you'll have to edit a layout.ini file.

    That way you'll map lv3-4 (AltGr) too, should you be interested.

    Example (using my Colemak[eD] layout.ini file):

    SC010 = Q    5    q    Q    --    ‚    „    ; QWERTY qQ
    SC011 = W    5    w    W    --    ‘    “    ; QWERTY wW
    SC012 = E    5    e    E    --    ↓    ↑    ; QWERTY eE
    SC013 = R    1    r    R    --    ®    ™    ; QWERTY rR
    SC014 = T    5    t    T    --    þ    Þ    ; QWERTY tT
    SC015 = Y    5    y    Y    --    ›    »    ; QWERTY yY
    SC016 = U    5    u    U    --    ‹    «    ; QWERTY uU
    SC017 = I    5    i    I    --    —    →    ; QWERTY iI
    SC018 = O    5    o    O    --    º    ª    ; QWERTY oO
    SC019 = P    5    p    P    --    π    ¶    ; QWERTY pP
    SC01a = OEM_4    4    [    {    *{Esc}    å    Å    ; QWERTY [{
    SC01b = OEM_6    4    ]    }    --    α    δ    ; QWERTY ]}
    SC01e = A    5    a    A    --    æ    Æ    ; QWERTY aA
    SC01f = S    1    s    S    --    ß    §    ; QWERTY sS
    SC020 = D    5    d    D    --    ð    Ð    ; QWERTY dD
    SC021 = F    5    f    F    --    ’    ”    ; QWERTY fF
    SC022 = G    1    g    G    --    ŋ    Ŋ    ; QWERTY gG
    SC023 = H    1    h    H    --    ε    ə    ; QWERTY hH
    SC024 = J    5    j    J    --    ʃ    Ʃ    ; QWERTY jJ
    SC025 = K    1    k    K    --    ç    Ç    ; QWERTY kK
    SC026 = L    5    l    L    --    ł    Ł    ; QWERTY lL
    SC027 = OEM_1    0    ;    :    --    dk1    …    ; QWERTY ;: - dk_umlaut
    SC028 = OEM_7    0    '    "    --    dk2    ′    ; QWERTY '"" - dk_acute
    SC02b = OEM_5    4    \    |    --    dk4    ¦    ; QWERTY \| - dk_grave
    SC056 = OEM_102    1    œ    Œ    --    ø    Ø    ; QWERTY OEM_102
    SC02c = Z    5    z    Z    --    ʒ    Ʒ    ; QWERTY zZ
    SC02d = X    5    x    X    --    †    ‡    ; QWERTY xX
    SC02e = C    5    c    C    --    ©    ¢    ; QWERTY cC
    SC02f = V    5    v    V    --    γ    ÷    ; QWERTY vV
    SC030 = B    1    b    B    --    β    •    ; QWERTY bB
    SC031 = N    5    n    N    --    –    ←    ; QWERTY nN
    SC032 = M    1    m    M    --    µ    ×    ; QWERTY mM

    Actually, that should be all you need - make a copy of a colemak layout and name it qwerty or whatever you want to, then replace the layout.ini code from Q to M inclusive with the above. Edit pkl.ini to activate this layout and hey presto. :)

    If you've got anything special you'd like on the number row or elsewhere you'd of course have to make sure that gets fixed as well.

    To get back and forth you can use the suspend hotkey. You could autostart PKL with the 'start suspended' option on (see pkl.ini).

    I haven't supported QWERTY so far since I saw no real point to it. You've convinced me to add a QWERTY layout to my PKL portfolio. ;)

    Last edited by DreymaR (18-Jun-2013 10:10:29)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 18-Jun-2013
    • Posts: 6

    Thanks DreymaR, that worked great! (After restoring spaces to tabs in the .ini sample)

    How can I start PKL suspended? I couldn't find that option

    Last edited by mattme (18-Jun-2013 18:23:29)
    Offline
    • 0
    • Reputation: 210
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,343

    In the [pkl] section of pkl.ini you'll find this bit:

    ; If it is yes/true/1, pkl will start up suspended.
    ; (Yes, I know the helper image is appearing and hiding.)
    ; I think it's better to start PKL when you need it instead.
    startsInSuspendMode = no

    Edit that entry to a 'yes', obviously. :)

    Above that are some timeout options that will auto-suspend PKL after a given time of user inactivity, should you be interested. I use the suspendHotkey instead, set to Ctrl+Shift+`.

    Last edited by DreymaR (19-Jun-2013 09:16:10)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 18-Jun-2013
    • Posts: 6

    Strange. That option wasn't in my pkl.ini . Added it, but had no effect. Are we using the same version? I'm using Portable_Colemak_v0.3.zip from Sourceforge.

    Offline
    • 0
    • Reputation: 210
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,343

    I'm actually using the v0.4 beta pkl.exe (also found on Sourceforge), but I thought that option was in v0.3 nevertheless?

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 18-Jun-2013
    • Posts: 6

    That worked thanks Dreymar

    Offline
    • 0
    • Reputation: 0
    • Registered: 18-Jun-2013
    • Posts: 6

    Problem: punctuation isn't quite right, perhaps because I have UK keyboard and Colemak UK layout. Is there an easy way to run a given layout in reverse?

    ;
    ; Keyboard Layout definition for
    ; Portable Keyboard Layout 
    ; http://pkl.sourceforge.net
    ;
    
    [informations]
    layoutname           = ColemakUk
    layoutcode           = ColemakUk
    localeid             = 00000809
    
    [global]
    shiftstates = 0:1:2:6:7
    
    
    [fingers]
    row1 = 1123445567888
    row2 = 1123445567888
    row3 = 1123445567888
    row4 = 11234455678
    
    [layout]
    ;scan = VK  CapStat 0Norm   1Sh 2Ctrl   6AGr    7AGrSh  Caps    CapsSh
    SC002 = 1   0   1   !   --  ¡   ¹   ; QWERTY 1!
    SC003 = 2   0   2   "   --  º   ²   ; QWERTY 2@
    SC004 = 3   0   3   £   --  ª   ³   ; QWERTY 3#
    SC005 = 4   0   4   $   --  ¢   £   ; QWERTY 4$
    SC006 = 5   0   5   %   --  €   ¥   ; QWERTY 5%
    SC007 = 6   4   6   ^   --  ħ   Ħ   ; QWERTY 6^
    SC008 = 7   4   7   &   --  ð   Ð   ; QWERTY 7&
    SC009 = 8   4   8   *   --  þ   Þ   ; QWERTY 8*
    SC00a = 9   0   9   (   --  ‘   “   ; QWERTY 9(
    SC00b = 0   0   0   )   --  ’   ”   ; QWERTY 0)
    SC00c = OEM_MINUS   0   -   _   --  –   —   ; QWERTY -_
    SC00d = OEM_PLUS    0   =   +   --  ×   ÷   ; QWERTY =+
    SC010 = Q   5   q   Q   --  ä   Ä   ; QWERTY qQ
    SC011 = W   5   w   W   --  å   Å   ; QWERTY wW
    SC012 = F   5   f   F   --  ã   Ã   ; QWERTY eE
    SC013 = P   5   p   P   --  ø   Ø   ; QWERTY rR
    SC014 = G   1   g   G   --  dk1 ~   ; QWERTY tT
    SC015 = J   5   j   J   --  đ   Đ   ; QWERTY yY
    SC016 = L   5   l   L   --  ł   Ł   ; QWERTY uU
    SC017 = U   5   u   U   --  ú   Ú   ; QWERTY iI
    SC018 = Y   5   y   Y   --  ü   Ü   ; QWERTY oO
    SC019 = OEM_1   4   ;   :   --  ö   Ö   ; QWERTY pP
    SC01a = OEM_4   0   [   {   --  «   ‹   ; QWERTY [{
    SC01b = OEM_6   0   ]   }   --  »   ›   ; QWERTY ]}
    SC01e = A   5   a   A   --  á   Á   ; QWERTY aA
    SC01f = R   1   r   R   --  dk2 ~   ; QWERTY sS
    SC020 = S   5   s   S   --  ß   ~   ; QWERTY dD
    SC021 = T   5   t   T   --  dk3 dk4 ; QWERTY fF
    SC022 = D   1   d   D   --  dk5 ~   ; QWERTY gG
    SC023 = H   1   h   H   --  dk6 ~   ; QWERTY hH
    SC024 = N   5   n   N   --  ñ   Ñ   ; QWERTY jJ
    SC025 = E   5   e   E   --  é   É   ; QWERTY kK
    SC026 = I   5   i   I   --  í   Í   ; QWERTY lL
    SC027 = O   5   o   O   --  ó   Ó   ; QWERTY ;:
    SC028 = OEM_7   4   '   @   --  õ   Õ   ; QWERTY '"
    SC029 = OEM_3   0   `   ¬   --  dk7 ~   ; QWERTY `~
    SC02b = OEM_5   0   #   ~   --  dk8 ~   ; QWERTY \|
    SC02c = Z   5   z   Z   --  æ   Æ   ; QWERTY zZ
    SC02d = X   1   x   X   --  dk9 ~   ; QWERTY xX
    SC02e = C   5   c   C   --  ç   Ç   ; QWERTY cC
    SC02f = V   5   v   V   --  œ   Œ   ; QWERTY vV
    SC030 = B   1   b   B   --  dk10    ~   ; QWERTY bB
    SC031 = K   1   k   K   --  dk11    ~   ; QWERTY nN
    SC032 = M   5   m   M   --  dk12    ~   ; QWERTY mM
    SC033 = OEM_COMMA   4   ,   <   --  dk13    ~   ; QWERTY ,<
    SC034 = OEM_PERIOD  4   .   >   --  dk14    ~   ; QWERTY .>
    SC035 = OEM_2   0   /   ?   --  ¿   ~   ; QWERTY /?
    SC039 = SPACE   0   ={space}    ={space}    --  ={space}        ; QWERTY Space
    SC056 = OEM_102 0   \   |   --  –   —   ; QWERTY OEM_102
    SC053 = DECIMAL 0   .   .   --  --  --  ; QWERTY Decimal in Numpad
    Last edited by mattme (12-Sep-2013 11:45:56)
    Offline
    • 0
    • Reputation: 210
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,343

    Hmmm... now I've stated up there that you couldn't use a "virtualkey" layout but it seems that's exactly what you need now? A layout that lets you hit, say, Colemak T and it produces the corresponding QWERTY key event (F).

    In my PKL files (from my sig topic) there's a layout called 'vk_qwerty-No_ISO'. The 'No' part means I've tested it on a Norwegian board (as you can see in the comment strings), but it should work just fine for a UK board. Let me know if it fits your bill.

    You can combine virtualkey and fully defined mappings should you wish to. Then you could have extra symbols on some keys but the default system mappings on other keys (like the number row).

    Last edited by DreymaR (12-Sep-2013 12:39:30)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 18-Jun-2013
    • Posts: 6

    Hi Dreymar. Thanks for all your help. I've everything almost perfect. One problem. With my Colemak to Qwerty script running, the semi-colon key still types o (as in Colemak). Any ideas?

    https://gist.github.com/matt-hickford/6778777

    Edit: sorry I couldn't download your no_iso layout because Dropbox is blocked at my work https://forum.colemak.com/viewtopic.php?id=1467 https://dl.dropboxusercontent.com/u/145 … reymaR.zip

    Last edited by mattme (01-Oct-2013 14:57:19)
    Offline
    • 0
    • Reputation: 210
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,343

    Hmmm. For one thing, your ISO_1 key shouldn't be a CapsStat 5 but 0 key (i.e., it's like the number/symbols keys not the letter keys) – but that shouldn't be enough to throw the layout and just means that your Caps states will be wonky. It's 1 to make the key affected by Caps state, 5 if the AltGr mapping is affected too. Amusingly enough, going through my own PKL layout files I just found a slew of Caps errors. I don't use the Caps state much...

    Possibly you may have to use another ISO_# for that key. On my keyboard there's OEM_1 (;:), 2 (/?), 3 (`~), 4 ([{), 5 (\|), 6 (]}) and 7 ('") but yours may be different. You could check out which keys do what. Bit of a long shot though.

    Try this:

    SC027 = OEM_1    VirtualKey    ; QWERTY semicolon

    (I actually had OEM_3 there – QWERTY-NO 'Ø'. You might try that too then since the Norwegian Ø is on the semicolon key.)

    You'd lose the óÓ since that's not defined in the base system layout, but that may be acceptable and at any rate help you determine the problem better. I use dead keys for accents since I need many of them and like this solution – keep in mind that if your system layout has dead keys then pkl.ini needs to be told which ones they are.

    Tip for your Github script: You should state "If your Windows system keyboard layout is anything other than QWERTY UK" instead of "If your Windows keyboard layout is Colemak UK"! The script is just as useful for a Dvorak or what-have-you user. You might add that the AltGr mappings are your own though (or even mention Colemak-eD).

    Last edited by DreymaR (07-Oct-2013 12:24:58)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
      • Index
      • Technical
      • Reverse PKL (colemak to qwerty) for colleague's sake