This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Modifier Keys KDE4

Tags: None
(comma "," separated)
fatum77
Registered Member
Posts
2
Karma
0

Modifier Keys KDE4

Tue Oct 21, 2008 4:07 am
I just installed Kubuntu on my older Powerbook 12" 1.33 ghz. It is much faster than it was with OS X but I am a "Mac Guy." I upgraded to KDE4 right after installation and can not for the life of me figure out how to change the modifier key from control to command system wide. In KDE3 this was easy but I can not find the option in KDE4. Can anyone help me I would hate to stop using KDE4 but I am so used to using command? On a side note the last time I installed a linux distro it was no where near as polished as this time. It has certainly come a long way since I first used SUSE in the late 90's.
User avatar
mensch
Registered Member
Posts
178
Karma
0
OS

RE: Modifier Keys KDE4

Tue Oct 21, 2008 7:44 am
The Command key is seen by Linux distros as the Win key (the irony). You can swap the Control and Command in the System Settings.

System Settings > Regional & Language > Keyboard Layouts

Select "Enable keyboard layouts" if the Advanced tab isn't available to you. Under Alt/Win key behavior you can set an option to swap the Win and Control keys.

You can have more detailed control by using xmodmap, I'll post a quick guide for that later if the above doesn't do what you want - for me it doesn't, so I've resorted to xmodmap.[hr]
So xmodmap. If you want more detailed control over what keys should be doing on your setup this might be the way to go. I still use some Apple hardware, apart from a Macbook Pro I've got two external Apple keyboards. Just swapping the Control and Command keys didn't do the trick for me, I wanted some additional changes (± and ~ should be in their respective places, for example).

  1. Create a file called .Xmodmap (or whatever name suits you) somewhere in your home directory.
  2. This is the contents of my current .Xmodmap, you can filter out whatever you want in the snippet below. The comments should explain what's being done here:
    Code: Select all
    ! Make the key left of the 'z' the grave/asciitilde key
    keycode 94 = section plusminus

    ! Make the key left of the '1' the section/plusminus key
    keycode 49 = grave asciitilde

    ! Add the euro sign to the '2' key
    keycode 11 = 2 at EuroSign

    ! Swap Control_L and Super_L
    remove mod4 = Super_L
    remove control = Control_L
    keysym Control_L = Super_L
    keysym Super_L = Control_L
    add mod4 = Super_L
    add control = Control_L

    !Enable the compose key
    keycode 116 = Multi_key
  3. Save the file and load it by entering "xmodmap /path/to/.Xmodmap" in a terminal.
  4. You'll have to do this every session, so it might be a good idea to add an Autostart entry for xmodmap. Create a new file called "xmodmap.sh" and add the following:
    Code: Select all
    #!/bin/sh
    xmodmap /path/to/.Xmodmap
    exit
  5. Go to System Settings > Advanced > Autostart and click the "Add script" button and point to the location of "xmodmap.sh". Uncheck "Create as symlink" and save.
  6. xmodmap should now load all your settings on KDE startup.

Last edited by mensch on Tue Oct 21, 2008 2:04 pm, edited 1 time in total.


I have forced myself to contradict myself in order to avoid conforming to my own taste. Marcel Duchamp
fatum77
Registered Member
Posts
2
Karma
0

RE: Modifier Keys KDE4

Tue Oct 21, 2008 2:00 pm
Thanks for the reply did exactly what you posted and did the trick. I am going to have to play around with the config of it a little. I was thinking since I set it to a macintosh computer keyboard that it wouldn't still consider it a windows key but I was wrong. Thanks again.
Germ
Registered Member
Posts
1
Karma
0

RE: Modifier Keys KDE4

Sun Nov 02, 2008 5:18 pm
Very nice, mensch. Thanks. :)
julianmann
Registered Member
Posts
2
Karma
0

Re: Modifier Keys KDE4

Tue Nov 06, 2012 12:49 pm
Very helpful! Thank you.

One question... On a mac in a shell the Ctrl keys behave the same as a shell on linux. Ctrl+Z, Ctrl+C etc. When I swap Ctrl and Cmd as described above, Ctrl no longer works in a shell and instead Cmd+Z now suspends a process, Cmd+C terminates it, and so on.

Is it possible to swap Ctrl and Cmd as described above, yet override this behaviour for the terminal?

Thanks

Julian
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Modifier Keys KDE4

Fri Nov 09, 2012 11:02 pm
That will not be possible, as the keymap determines what the keypresses register as to applications. They have no knowledge of the physical keyboard - they only know what X tells them.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell