You are not logged in.

#1 2008-10-31 23:17:20

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

[SOLVED] Remapping Alt_R with xmodmap disable VC terminal switching

I recently remapped my Alt_R key to work as mod4 (my Windows key), but in doing so I can longer switch to a v/c terminal with Control + Alt_L + F1-F6.  Remapping the right Alt shouldn't affect actions of the left Alt, should it?

Further investigation has shown that if I add Alt_R to any modifier other than mod1, I can no longer access v/c 1-6 within X by using the C+A+Fx shortcut.

I'm using the following to configure the key:

xmodmap -e "remove mod1 = Alt_R"
xmodmap -e "add mod4 = Alt_R"

Google results about this are few and far between, and I've found no solutions.  This seems like a simple and somewhat common task.  Has anyone else here encountered this and if so did you find a workaround?

Essentially, I just want the Right Alt key to perform that same dwm tasks as the Windows key (mod4), without having to duplicate each and every keybind.

Xmodmap shows the following before I change the settings:

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x6d)
mod1        Alt_L (0x40),  Alt_R (0x71),  Meta_L (0x9c)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x7f),  Hyper_L (0x80)
mod5        Mode_switch (0x5d),  ISO_Level3_Shift (0x7c)

...and the following after the remap:

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x6d)
mod1        Alt_L (0x40),  Meta_L (0x9c)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x7f),  Hyper_L (0x80),  Alt_R (0x71)
mod5        Mode_switch (0x5d),  ISO_Level3_Shift (0x7c)

...and the relevant portion of /etc/X11/xorg.conf:

Section "InputDevice"
    Identifier  "Dell Keyboard"
    Driver      "kbd"
    Option      "XkbRules"      "xorg"
    #Option      "XkbModel"      "pc105"
    Option      "XkbModel"      "inspiron"
    Option      "XkbLayout"     "us"
    Option      "Autorepeat"    "250 50"   # Repeat pause and speed
EndSection

Last edited by thayer (2008-11-01 17:15:48)


thayer williams ~ cinderwick.ca

Offline

#2 2008-11-01 17:14:57

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: [SOLVED] Remapping Alt_R with xmodmap disable VC terminal switching

I figured out another way of making it work and properly:

First, find out which keycode Alt_R is assigned to:

xmodmap -pke | grep Alt_R

Then simply add the following to your startup script (e.g. ~/.xinitrc), changing the keycode ''113'' if necessary to the above result:

xmodmap -e "keycode 113 = Super_L"  # reassign Alt_R to Super_L
xmodmap -e "remove mod1 = Super_L"  # make sure X keeps it out of the mod1 group

Now any functions that are triggered by a Super_L (Windows) key press will also be triggered by an Alt_R key press.

Last edited by thayer (2008-11-01 17:34:12)


thayer williams ~ cinderwick.ca

Offline

Board footer

Powered by FluxBB