Choose style:

Author Topic: Permanently swapping Control and Command Keys [SOLVED]  (Read 119 times)

0 Members and 1 Guest are viewing this topic.

Offline kimtoufectis

  • nOOb
  • *
  • Posts: 17
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Permanently swapping Control and Command Keys [SOLVED]
« on: October 11, 2017, 05:57:36 pm »
Hello community...

As a Mac user (both on work and home machines) I am constantly activating the menu when trying to copy, paste, delete, search within, or print  selected material, set a bookmark, or refresh my browser.  This happens because Macs use the Command and Control keys for the opposite purposes as with Windows and Linux machines.  A similar solved post yielded a proposal to

Code: [Select]
gedit ~/.config/peppermint-control-center/xbindkeys.conf
and while I am minimally savvy enough to edit a file with adequate instructions, I didn't see what in the displayed file to edit to swap the function of these two keys.

So if I've adequately articulated the problem, I'll move on to my goal:  to have the Control key activate the menu, and have either of the Command keys (just left and right of my space bar) combine with c, d, f, p, r, v, or x to copy, bookmark, find, print, refresh, paste, or delete selected material, on a persistent basis.  (Might there be an app for that?)

[In case it's relevant I'm (otherwise contentedly) using P8 on an early 2006 32-bit Polycarbonate Intel iMac (yes, admittedly it and I are quite the fossils I know).]
« Last Edit: October 13, 2017, 11:03:34 pm by kimtoufectis »

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1251
  • Karma: 229
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8
Re: Permanently swapping Control and Command Keys
« Reply #1 on: October 11, 2017, 06:30:41 pm »
I don't think xbindkeys is the right way to go about it.

Running a couple of xmodmap commands at boot or login to remap those keys is a better idea. I'm not sure of the exact keycodes but see if this helps:

https://askubuntu.com/questions/131900/how-do-i-switch-the-command-key-and-control-key-on-a-macbook-pro



Offline kimtoufectis

  • nOOb
  • *
  • Posts: 17
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: Permanently swapping Control and Command Keys
« Reply #2 on: October 13, 2017, 01:21:57 am »
Thanks for this.
  • The first answer assumes knowledge beyond my ken; no idea how to follow it
  • The second and fourth didn't match any of the P8 "Layout Options" on my machine; apparently these instructions applied to an earlier version of Peppermint
  • The third caused me to disable the Control key function so I couldn't close and save changes to the file it asked me to edit in nano
  • The fifth got close, restoring the Control key function on the Alt key rather than the Command key
  • The sixth also provided insufficient information for me to proceed

...so I didn't quite get there.  I'm not savvy at this stuff but willing to follow instructions...

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1251
  • Karma: 229
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8
Re: Permanently swapping Control and Command Keys
« Reply #3 on: October 13, 2017, 09:45:15 am »
OK, for the first one you would open the terminal and enter:
Code: [Select]
gedit ~/.Xmodmap
then paste this into the editor:

Code: [Select]
clear control
clear mod4

keycode 105 =
keycode 206 =

keycode 133 = Control_L NoSymbol Control_L
keycode 134 = Control_R NoSymbol Control_R
keycode 37 = Super_L NoSymbol Super_L

add control = Control_L
add control = Control_R
add mod4 = Super_L
Save and exit.

Now run this in the terminal:
Code: [Select]
xmodmap ~/.Xmodmap

Do your keys swap as you want them to?

Offline kimtoufectis

  • nOOb
  • *
  • Posts: 17
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: Permanently swapping Control and Command Keys [SOLVED]
« Reply #4 on: October 13, 2017, 12:23:24 pm »
In one try.  Thanks for the clear instructions!


Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1251
  • Karma: 229
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8
Re: Permanently swapping Control and Command Keys
« Reply #5 on: October 13, 2017, 01:56:37 pm »
Good news but you'll have to make it permanent.

Go to the main menu at the left of the panel, then Settings > Peppermint Settings Panel > System > Default applications

Click on Autostart at the left. Under Manual autostarted applications, in the text box put

Code: [Select]
xmodmap /home/YOURUSERNAME/.Xmodmap
Obviously replace YOURUSERNAME with your exact user name as it appears in Peppermint.
Then click on the Add button with the green + sign. That should make the keys swap every time you boot.

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 17341
  • Karma: 2080
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8 (64bit)
Re: Permanently swapping Control and Command Keys
« Reply #6 on: October 13, 2017, 03:10:50 pm »
No he shouldn't need to do anything more to make it permanent .. ~/.Xmodmap is actioned automatically at login if it exists ;)

There should be no need to autostart it.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1251
  • Karma: 229
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8
Re: Permanently swapping Control and Command Keys
« Reply #7 on: October 13, 2017, 03:35:12 pm »
Ah, okay, I was just going by what the Ubuntu forum answer was saying, cheers :)

@kimtoufectis, please edit your first post to mark the entire thread as [SOLVED], thanks  ;)