LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2011, 11:23 AM   #1
hillgreen
LQ Newbie
 
Registered: Dec 2010
Posts: 4

Rep: Reputation: 0
Lightbulb 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?

Last edited by hillgreen; 01-14-2011 at 06:48 AM. Reason: To specify it.
 
Old 01-11-2011, 09:06 AM   #2
xandercage17
Member
 
Registered: Sep 2009
Posts: 125

Rep: Reputation: Disabled
Delete My account

Last edited by xandercage17; 04-22-2012 at 02:20 PM. Reason: Delete My account
 
Old 01-14-2011, 09:32 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
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"

Last edited by archtoad6; 01-16-2011 at 07:36 AM. Reason: no new post needed
 
Old 01-15-2011, 10:38 AM   #4
xandercage17
Member
 
Registered: Sep 2009
Posts: 125

Rep: Reputation: Disabled
Delete My account

Last edited by xandercage17; 04-22-2012 at 02:20 PM. Reason: Delete My account
 
  


Reply

Tags
ctrl, emacs, keymapping, swap



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
control-alt-del and control f2? Romanus81 Slackware 1 03-11-2008 04:41 PM
Alt no longer META key when using in-terminal option of Emacs (emacs -nw) frznchckn Linux - Software 1 06-02-2007 02:41 AM
Emacs LISP - function and keymap? jantman Programming 5 09-28-2006 11:59 AM
uk keymap for Xorg.ccnf doesn't allow virtual terminal switching... Oholiab Linux - General 1 01-13-2006 08:37 AM
Right ALT key, 'agetty' on unused virtual terminal. Tarts Linux - Newbie 0 08-14-2003 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration