Quantcast

Swap/Remap Ctrl and Alt keys

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Swap/Remap Ctrl and Alt keys

Tuxman
Has anyone been able to swap the Ctrl and Alt keys?

That swap would make it more like a Mac when using the keyboard commands.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

ishii kazuo
There are several ways to swap keymap.
Refer below.
You can swap it in X and console.

http://www.uluga.ubuntuforums.org/showthread.php?t=633403

2008/6/8 Young <[hidden email]>:
> Has anyone been able to swap the Ctrl and Alt keys?
>
> That swap would make it more like a Mac when using the keyboard commands.
>
> --
> ubuntu-users mailing list
> [hidden email]
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>



--
Kazuo Ishii Ph.D., Tokyo Univ. of Science
[hidden email]

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Tuxman
Kazuo Ishii wrote:

> There are several ways to swap keymap.
> Refer below.
> You can swap it in X and console.
>
> http://www.uluga.ubuntuforums.org/showthread.php?t=633403
>
> 2008/6/8 Young <[hidden email]>:
>  
>> Has anyone been able to swap the Ctrl and Alt keys?
>>
>> That swap would make it more like a Mac when using the keyboard commands.
>>
>> --
>> ubuntu-users mailing list
>> [hidden email]
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>
>>    

That discussions was hard to follow. I couldn't get anything out of that
I could try to use.
Have you switched the keys (Ctrl and Alt) yourself? Or something similar?

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Mario Vukelic
In reply to this post by Tuxman
On Sat, 2008-06-07 at 13:41 -0500, Young wrote:
> Has anyone been able to swap the Ctrl and Alt keys?

Did you try menu System > Preferences > Keyboard > tab "Layouts" >
button "Layout Options"?


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Tuxman
Mario Vukelic wrote:
On Sat, 2008-06-07 at 13:41 -0500, Young wrote:
  
Has anyone been able to swap the Ctrl and Alt keys?
    

Did you try menu System > Preferences > Keyboard > tab "Layouts" >
button "Layout Options"?


  
Yes. That would be a very reasonable place to put the option for switching Ctrl and Alt.
The closest they get is "Right Ctrl works as Right Alt."
I need the left side swapped.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Mario Vukelic
On Sat, 2008-06-07 at 17:22 -0500, Young wrote:
> Yes. That would be a very reasonable place to put the option for
> switching Ctrl and Alt.
> The closest they get is "Right Ctrl works as Right Alt."
> I need the left side swapped.

Hmmm, I thought I had seen the option there, but no can't find it now,
either. Check out the xkeycaps package, then:


Description: manipulate X11 keymaps (for xmodmap) graphically
xkeycaps is a graphical front-end to xmodmap(1). It opens a window that
looks like a keyboard; moving the mouse over a key shows what KeySyms
and Modifier bits that key generates. Clicking on a key simulates
KeyPress/KeyRelease events on the window of your choice. It is possible
to change the KeySyms and Modifiers generated by a key through a
mouse-based interface. This program can also write an input file for
xmodmap to recreate your changes in future sessions


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Tuxman
Mario Vukelic wrote:
On Sat, 2008-06-07 at 17:22 -0500, Young wrote:
  
Yes. That would be a very reasonable place to put the option for
switching Ctrl and Alt.
The closest they get is "Right Ctrl works as Right Alt."
I need the left side swapped.
    

Hmmm, I thought I had seen the option there, but no can't find it now,
either. Check out the xkeycaps package, then:


Description: manipulate X11 keymaps (for xmodmap) graphically
xkeycaps is a graphical front-end to xmodmap(1). It opens a window that
looks like a keyboard; moving the mouse over a key shows what KeySyms
and Modifier bits that key generates. Clicking on a key simulates
KeyPress/KeyRelease events on the window of your choice. It is possible
to change the KeySyms and Modifiers generated by a key through a
mouse-based interface. This program can also write an input file for
xmodmap to recreate your changes in future sessions


  
Mario,
Have you used X11 keycaps?
Mark


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Mario Vukelic
On Sat, 2008-06-07 at 19:55 -0500, Young wrote:
> Have you used X11 keycaps?

Many, many, many years ago. Why?


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Mario Vukelic
In reply to this post by Tuxman
On Sat, 2008-06-07 at 19:55 -0500, Young wrote:
> Have you used X11 keycaps?

If you wanted to ask how it works:
      * Start xkeycaps
      * Select the correct keyboard type
      * Right-click the Ctrl key in the virtual keyboard
      * Select "Exchange Keys"
      * When prompted, click the Alt Key. The keys are now exchanged
      * Let it write the xmodmap file
      * Include the xmodmap command to read the xmodmap file in some
        appropriate startup script
      * See "man xkeycaps" ang Google for details


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Tuxman
Mario Vukelic wrote:
On Sat, 2008-06-07 at 19:55 -0500, Young wrote:
  
Have you used X11 keycaps?
    

If you wanted to ask how it works: 
      * Start xkeycaps
      * Select the correct keyboard type
      * Right-click the Ctrl key in the virtual keyboard
      * Select "Exchange Keys"
      * When prompted, click the Alt Key. The keys are now exchanged
      * Let it write the xmodmap file
      * Include the xmodmap command to read the xmodmap file in some
        appropriate startup script
      * See "man xkeycaps" ang Google for details


  

That sounds like an easy way to do it.  I'll give it a try.  Does it persist through a restart?

Several days ago I tried using xmodmap directly. but seemed to find that it didn't really change what I wanted to change.

This is an excerpt from a 6/3 email to my local Linux User Group.
-------------------------------------------------------------------------------------------
I've never used xmodmap before, so I guess I'm missing something in the documentation.
This is a new Ubuntu 8.04 install.

I want to swap the Ctrl and Alt keys, and I'd appreciate any help you can give.

Using XEV I got this for my keyboard.

Left Ctrl key    keysym 0xffe3 = keycode 37 = Control_L
Right Ctrl key    keysym 0xffe4 = keycode 109 = Control_R
Left Alt key    keysym 0xffe9 = keycode 64 = Alt_L
Right Alt key    keysym 0xffea = keycode 113 = Alt_R

Then I run this to Swap Ctrl & Alt.

~$ xmodmap -e "keycode 64 = Control_L"
~$ xmodmap -e "keycode 113 = Control_R"
~$ xmodmap -e "keycode 37 = Alt_L"
~$ xmodmap -e "keycode 109 = Alt_R"

Checking results with XEV. Now I get this:

Left Ctrl key    keysym 0xffe9 = keycode 37 = Alt_L
Right Ctrl key    keysym 0xffea = keycode 109 = Alt_R
Left Alt key    keysym 0xffe3 = keycode 64 = Control_L
Right Alt key    keysym 0xffe4 = keycode 113 = Control_R

But, when using a keyboard command like Alt+V to Copy as the replacement for Ctrl+V, it doesn't work. The Ctrl+V still performs a Paste.

I knew that what I did should only work until the next reboot, but I was going to figure out how to add it to a startup script later.
-----------------------------------------------------------------------------------------


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys

Tuxman
Thanks Mario for the info on xkeycaps.

I have it working the way I want it to now.

Both Alt keys and Ctrl keys are swapped, so I can use the keys next to 
the space bar, as if it were a Mac.

One thing that has changed is that you don't have to add it to a 
startup/login script. If you restart after saving the change in 
xkeycaps, when you log back in a window pops up asking what you want to 
do with the .xmodmap file you've created. Just select the file, not the 
backup, and from then on it runs at login. I'm left to wonder if it 
could catch any additional changes made later. Maybe I should test that.

I don't know if Ubuntu is watching your home folder for new files, or if 
something else triggered this. It seems to be usual in Ubuntu, for 
programs and utilities to not tell you their name, nor give you a way to 
find it.

Either way it was a big help to me since I've yet to learn how to create 
and run startup scripts, and the google search for help wasn't encouraging.

Regarding xkeycaps still. There were a couple of things that left me 
wondering.
It shows a message saying you need to add a line to a login script to 
contain:
xmodmap~/.xmodmap-`uname-n`
with a note that ` is a back quote.

First I don't know what ~ means, and there's no way I know of to google 
that. From the context, and knowing where it saved the change file I'm 
guessing that ~ means /home/username. Is that the case, and is it always so?

Second, what do the back quotes mean? Do they simply indicate that uname 
should be changed to the correct users name? Would they be required as 
part of the syntax? And why is there a -n inside the back quotes?

Third, figuring out which keyboard matches the one on your machine isn't 
straight forward. The names don't match what you find in other places on 
your system. The good thing is that the graphic display of the keyboard 
changes for each, so you get a lot of help that way.


This has been a very frustrating experience, and a real eye-opener. It 
took me 5 days to solve this. On WinXP it took me less than 20 minutes, 
from the time I thought of it, until it was accomplished. And that was 
finding a program to do it which I had never used before, (AutoHotKeys), 
downloading it, reading the documentation, writing the script, and 
setting it to run at startup. And I didn't need anyone's help.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Swap/Remap Ctrl and Alt keys #Update 64bit xkeycaps

Young-22
In the past I was able to use xkeycaps to swap the Ctrl and Alt keys.
More of a Mac type layout which helps me a lot.

With a new machine and AMD64 version of Ubuntu, xkeycaps is very flaky,
I can't even get it to scroll to the keyboard selection. Of course
everything is different, so it could be something besides 64 bit causing
the problem.

As a work around I was able to copy the .xmodmap files from my home
folder on the old 32 bit machine to the new machine, log out, log in,
pick the displayed choice, and it works fine. Sometimes I just get lucky.


Mark


Young wrote:

> Thanks Mario for the info on xkeycaps.
>
> I have it working the way I want it to now.
>
> Both Alt keys and Ctrl keys are swapped, so I can use the keys next to
> the space bar, as if it were a Mac.
>
> One thing that has changed is that you don't have to add it to a
> startup/login script. If you restart after saving the change in
> xkeycaps, when you log back in a window pops up asking what you want to
> do with the .xmodmap file you've created. Just select the file, not the
> backup, and from then on it runs at login. I'm left to wonder if it
> could catch any additional changes made later. Maybe I should test that.
>
> I don't know if Ubuntu is watching your home folder for new files, or if
> something else triggered this. It seems to be usual in Ubuntu, for
> programs and utilities to not tell you their name, nor give you a way to
> find it.
>
> Either way it was a big help to me since I've yet to learn how to create
> and run startup scripts, and the google search for help wasn't encouraging.
>
> Regarding xkeycaps still. There were a couple of things that left me
> wondering.
> It shows a message saying you need to add a line to a login script to
> contain:
> xmodmap~/.xmodmap-`uname-n`
> with a note that ` is a back quote.
>
> First I don't know what ~ means, and there's no way I know of to google
> that. From the context, and knowing where it saved the change file I'm
> guessing that ~ means /home/username. Is that the case, and is it always so?
>
> Second, what do the back quotes mean? Do they simply indicate that uname
> should be changed to the correct users name? Would they be required as
> part of the syntax? And why is there a -n inside the back quotes?
>
> Third, figuring out which keyboard matches the one on your machine isn't
> straight forward. The names don't match what you find in other places on
> your system. The good thing is that the graphic display of the keyboard
> changes for each, so you get a lot of help that way.
>



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Loading...