• You are not logged in.
  • Index
  • Technical
  • How to switch command and control keys on the portable layout?

    How to switch command and control keys on the portable layout?

    • Started by tomorris
    • 13 Replies:
    • Reputation: 0
    • Registered: 31-Jan-2012
    • Posts: 22

    How to switch command and control keys on the portable layout?

    I have a mac keyboard that I'm using on a Windows PC.  I am using the portable layout and want to make it so that I can push the command keys instead of control in order to do stuff like copy, paste, etc.  Thanks fellow colemakians!

    Offline
    • 0
    • Reputation: 0
    • From: Switzerland
    • Registered: 21-Aug-2007
    • Posts: 176

    Dunno about the portable layout, but when I boot my Mac into Windows I wanna use Command as Ctrl, and to remap that I used SharpKeys.

    Offline
    • 0
    • Reputation: 1
    • From: Sofia, Bulgaria
    • Registered: 05-Mar-2011
    • Posts: 387

    If you want to completely swap the function of two keys, I can recommend KeyTweak. SharpKeys may work, it's just that I haven't tried it.

    Offline
    • 0
    • Reputation: 0
    • Registered: 31-Jan-2012
    • Posts: 22

    I am looking to edit the portable layout itself --- that way I have a portable solution and don't need admin privileges.  Any ideas?  I opened layout.ini in wordpad and can see all the code.

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

    By 'the portable layout', do you mean Portable Keyboard Layout (PKL) by Fárkas Máté, or something else?

    Ah, you mention a 'layout.ini' file; I'll assume you're using PKL then. See, I haven't had much experience trying to fiddle with modifier keys in that (apart from CapsLock). But you'll need the key's Scan Code for the start of the line, its Virtual Key code name for the next entry and then what you want to remap it to (which is the VK name again, or a symbol - for a modifier you'd use entries like '*{CapsLock}').

    So... atm I can't quite remember those but the SC/VK names should be 1d/LCtrl and 38/Alt I think (the VK name is capitalized in the 2nd column). Hope that helps!

    Last edited by DreymaR (15-Feb-2012 15:28:55)

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

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

    Okay, tell you what: I'll try to write the lines you need.

    SC01d = ALT    0    *{LAlt}    *{LAlt}    *{LAlt}    *{LAlt}    *{LAlt}    ; Left Ctrl becomes Left Alt
    SC038 = LCTRL    0    *{LCtrl}    *{LCtrl}    *{LCtrl}    *{LCtrl}    *{LCtrl}    ; Left Alt becomes Left Ctrl

    Or... what might work is this:

    SC01d = ALT    VirtualKey    ; Left Ctrl becomes Left Alt
    SC038 = LCTRL    VirtualKey    ; Left Alt becomes Left Ctrl

    Try it out!

    *** 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: 31-Jan-2012
    • Posts: 22

    Cool, thanks!  I will try it.

    I am using the portable layout liked from the Colemak site.

    Offline
    • 0
    • Reputation: 0
    • Registered: 31-Jan-2012
    • Posts: 22

    Sorry, neither of those worked.  But thanks for trying.  Anyone else might know?

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

    Uh, I think I know my way around PKL better than most - bar Mr. Máté who doesn't come here very often anymore. Maybe if you explain in more detail what you've done and what happened or didn't?

    *** 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: 31-Jan-2012
    • Posts: 22

    I tried adding those lines of code to the layout file --- both times, nothing changed.  Am just trying to switch the control and windows key.  (control and command on a mac keyboard)

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

    Hmmm...

    Never mind mapping to LAlt then! Should've had LWin (SC 15b) instead. Also, when mapping to values you should probably use 'Ctrl' rather than 'LCtrl' to get the generic modifier.

    You did add the lines below the other similar lines - that is, in the right section - I hope? And for the right layout? Just for the sake of testing, swap the Scan Codes of two letter lines and see whether those two letters will then swap places when you type them. (You'll have to deactivate and reactivate your layout in PKL for it to work - I usually switch to an alternate layout and back using a hotkey.)

    It'll be a good week until I get on a Windows computer again so I can test this out. I use mostly Linux these days!

    Last edited by DreymaR (17-Feb-2012 12:18:17)

    *** 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: 31-Jan-2012
    • Posts: 22

    thanks!  i will try this tomorrow at work !

    Offline
    • 0
    • Reputation: 0
    • Registered: 31-Jan-2012
    • Posts: 22

    Uh so what is the final lines of code I should use?  A bit confused here.

    Offline
    • 0
    • Reputation: 0
    • Registered: 31-Jan-2012
    • Posts: 22

    Any ideas ?

    Offline
    • 0
      • Index
      • Technical
      • How to switch command and control keys on the portable layout?