LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   emacs keymap: how to swap right alt and right control for virtual terminal ? (https://www.linuxquestions.org/questions/linux-software-2/emacs-keymap-how-to-swap-right-alt-and-right-control-for-virtual-terminal-855382/)

hillgreen 01-10-2011 11:23 AM

emacs keymap: how to swap right alt and right control for virtual terminal ?
 
My emacs 23 is running on Ubuntu 10.04 and I am very a emacs primer. Please tell me:
in virtual terminals, how can I remap keys to swap the right alt key and the right ctrl key automatically every time the machine starts up? Thank you.

My current hack is as following:
1:
When I start up my system every time, I run this bash script.
#!/bin/bash -

if [ -f ~/.xmodmaprc/xmodmaprc_R ];
then
xmodmap ~/.xmodmaprc/xmodmaprc_R
emacs -q -bg lightgreen -fg black -fh -fw 2> /dev/null
fi


2:
And my ~/.xmodmaprc/xmodmaprc_R file is like this.
!
! swap Alt_R and Control_R
!
remove mod1 = Alt_R
remove control = Control_R
keysym Control_R = Alt_R
keysym Alt_R = Control_R
add mod1 = Alt_R
add control = Control_R

By the way, I know how to swap CapsLK and Ctrl on the left side of keyboard in this way:
Open /etc/kdb/remap file in Ubuntu 10.04 and append below 2 lines to this file. And in this way I can swap Caps_Lock and Control in virtual terminal.
s/keycode *58 = Caps_Lock/keycode 58 = Control/;
s/keycode *29 = Control/keycode 29 = Caps_Lock/;

But how to swap Alt and Ctrl on the right side?

xandercage17 01-11-2011 09:06 AM

Delete My account

archtoad6 01-14-2011 09:32 AM

hillgreen,

Welcome to LQ.

I think you need to watch out for clicking the "Report" button instead of "Quote" the button. Your report of xandercage17's post only makes sense if it was an accident. Furthermore, I looked at the posted links & they seem appropriate. If they don't work for you, please be more specific about how & why they don't work for you, that would help us refine our suggestions for you.

Note & warning
I haven't used Emacs since the CP/M version on my Kaypro 10 in 1984.


xandercage17,

What portion of your post did you want to make Silver?
Thanks for fixing the "silver thing"

xandercage17 01-15-2011 10:38 AM

Delete My account


All times are GMT -5. The time now is 08:45 PM.