Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Alt key hell a.k.a. VT switching shortcut [WORKAROUND]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Mon Oct 12, 2009 8:58 pm    Post subject: Alt key hell a.k.a. VT switching shortcut [WORKAROUND] Reply with quote

With the recent xorg 1.6 upgrade, for some reason the alt-key plus any function key or left/right arrow key switches virtual terminals. In the past these shortcuts have required the ctrl key to be pressed as well. Now, however, this shortcut seems to be activated with only the alt key pressed. This conflicts with my work flow particularly bad since I often press the alt+left/right arrow keys to navigate backwards and forwards in firefox and eclipse and my muscle reflex cannot be easily retrained. Does anyone know how to disable or change the alt+left arrow keyboard shortcut or even better return to the old behavior and require ctrl+alt to be pressed in order to perform the VT switch?

Thanks so much.


Last edited by immudium on Tue Oct 13, 2009 9:03 pm; edited 2 times in total
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Tue Oct 13, 2009 3:17 pm    Post subject: Reply with quote

Fixed for now by editing /usr/bin/startx and passing in "-retro" to serverargs:
Code:
...
defaultserverargs="-nolisten tcp -br"
clientargs=""
serverargs="-retro"

enable_xauth=1
...


Tip found via this blog:
http://bgoglin.livejournal.com/16916.html

The blog doesn't directly address the issue of <Alt>+<Fn> switching VTs instead of <Ctrl>+<Alt>+<Fn> but the retro argument does appear to restore the requirement for Ctrl to be pressed, at least for me.
Back to top
View user's profile Send private message
myceliv
Apprentice
Apprentice


Joined: 29 Nov 2007
Posts: 178

PostPosted: Tue Oct 13, 2009 6:23 pm    Post subject: Reply with quote

Hmm, don't know if I should start a new thread instead. For me the -retro flag is too severe of a solution. Motorcycle turn signal is broken so drive the dump truck instead. I want to know how to fix the turn signal. :-)

This is not a big problem since chvt works ok, sort of. It prints a bunch of extra linefeeds to the X terminal emulator I use to chvt to one of the VTY's. But I'd love to know the magic hal fdi incantations to get ctrl-alt-<fn-key> to vt switch again. Or maybe it is some console kit thing? So far searching has not yielded any good information.

Any xorg experts know how we're "supposed to" re-enable VTY switching on fn keys?

x11-base/xorg-server 1.6.4
sys-apps/hal 0.5.13-r2
x11-drivers/xf86-input-evdev 2.2.5
x11-apps/xkbutils 1.0.1-r1
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Tue Oct 13, 2009 8:59 pm    Post subject: Reply with quote

myceliv wrote:
Hmm, don't know if I should start a new thread instead. For me the -retro flag is too severe of a solution. Motorcycle turn signal is broken so drive the dump truck instead. I want to know how to fix the turn signal. :-)

Totally agree. My ideal solution would be to fix the turn signal, but like you searching is yielding very little information and I was rather desperate for any kind of solution as I was dumping myself out to the terminal every 10 seconds.

If you'd like, I can remove the SOLVED tag and see if we can get some more feedback to this thread, but if you do start a new thread maybe you could post a link back to here or something. I'm still very interested in a *good* fix rather than my desperate hack/workaround.

[Edit]
Well, I changed the subject to WORKAROUND rather than SOLVED. Maybe that will be good enough?
[/Edit]
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Tue Oct 13, 2009 9:13 pm    Post subject: Reply with quote

Virtual terminal switching worked just fine in 1.6.
You've probably have your keyboard config messed up
(actually, I think I know how you've managed to do it,
but I'm withholding my guesses till I see your xorg.conf
and hal settings).
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Tue Oct 13, 2009 11:46 pm    Post subject: Reply with quote

VoidMage wrote:
...I'm withholding my guesses till I see your xorg.conf
and hal settings).


xorg.conf
Code:

#Section "ServerLayout"
#       Identifier        "Layout0"
#   Screen            "Screen0" 0 0
#EndSection

Section "Device"
   Identifier        "Videocard0"
   Driver           "nvidia"
   VendorName   "NVIDIA Corporation"
EndSection

Section "Screen"
   Identifier   "Screen0"
   Device            "Videocard0"
   Option            "TwinView" "1"
   Option            "AllowGLXWithComposite" "true"
   Option            "AddARGBGLXVisuals" "true"
EndSection

Section "Module"
   SubSection  "extmod"
             Option   "omit xfree86-dga"
   EndSubSection
EndSection

Section "Extensions"
       Option      "Composite"    "Enable"
EndSection


Not sure what you want to see on hal... I don't have a 10-x11-input.fdi or anything in /etc/hal/fdi/policy/

Thanks for any ideas.
Back to top
View user's profile Send private message
myceliv
Apprentice
Apprentice


Joined: 29 Nov 2007
Posts: 178

PostPosted: Wed Oct 14, 2009 12:23 am    Post subject: xorg and hal configs Reply with quote

VoidMage wrote:
You've probably have your keyboard config messed up

Very possibly. There's a lot of conflicting info out there about how to configure X11 these days. Thanks for taking a look.

Code:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/Type1"
   #  And a bunch of others left out since this forum doesn't fold code pastes
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "glx"
EndSection

Section "Monitor"
    Identifier     "CRT-0"
    VendorName     "Sun Microsystems"
    ModelName      "SUN GDM-5410"
    DisplaySize     386    290
    HorizSync       30.0 - 121.0
    VertRefresh     48.0 - 160.0
EndSection

Section "Monitor"
    Identifier     "CRT-1"
    VendorName     "Mitsubishi"
    ModelName      "Mitsubishi NSH1117K"
    DisplaySize     386    290
    HorizSync       30.0 - 108.0
    VertRefresh     50.0 - 160.0
EndSection

Section "Device"
    Identifier     "Top_Nvidia"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8800 GTS"
    BusID          "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "UseEdidDpi" "false"
    Option         "DPI" "105x105"
    Option         "Coolbits" "1"
    Option         "NoLogo" "1"
    Option         "TwinView" "1"
    Option         "TwinViewXineramaInfoOrder" "CRT-0"
    Option         "metamodes" "CRT-0: 1600x1200_75 +0+0, CRT-1: 1600x1200_75 +1600+0; CRT-0: 1600x1200 +0+0, CRT-1: 1600x1200 +1600+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "Enable"
EndSection


Code:

<?xml version="1.0" encoding="utf-8"?>
<deviceinfo version="0.2">
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.options" type="string">terminate:ctrl_alt_bksp</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>
/deviceinfo>
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Wed Oct 14, 2009 1:29 am    Post subject: Reply with quote

In such case I'm not sure - unless your desktop env is messing things up.
One way this could have happened was if you were using evdev,
but still had AllowEmptyInput "false" - in such case, console wouldn't be set
to "raw" (whatever that means - read comments in xorg-server sources)
and as recent evdev no longer grabs device (for quite awhile), Alt_Fn would
be sent to the console and trigger that switch. However, that one is supposed to be fixed
in 1.6.0 - it always sets "raw" there.
Back to top
View user's profile Send private message
Phlogiston
Veteran
Veteran


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Sun Oct 25, 2009 10:59 pm    Post subject: Reply with quote

Any solution for this? I'm having the very same issue.
_________________
Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor
Back to top
View user's profile Send private message
myceliv
Apprentice
Apprentice


Joined: 29 Nov 2007
Posts: 178

PostPosted: Sun Oct 25, 2009 11:47 pm    Post subject: Reply with quote

See this bug for clues.

Thanks for asking, Phlogiston.

You prompted me to search a little harder. I checked current 'setxkbmap -print' to confirm was on us map. Then ran manually 'setxkbmap us' which makes terminals switching again. Hurrah! Now to find out what is wrong in my config that that doesn't happen by itself.
Code:

$ setxkbmap -print
xkb_keymap {
   xkb_keycodes  { include "evdev+aliases(qwerty)"   };
   xkb_types     { include "complete"   };
   xkb_compat    { include "complete"   };
   xkb_symbols   { include "pc+us+inet(evdev)"   };
   xkb_geometry  { include "pc(pc104)"   };
};
$ setxkbmap us
$ # switching vty with C-A-<Fn> works again
$ setxkbmap -print
xkb_keymap {
   xkb_keycodes  { include "evdev+aliases(qwerty)"   };
   xkb_types     { include "complete"   };
   xkb_compat    { include "complete"   };
   xkb_symbols   { include "pc+us+inet(evdev)"   };
   xkb_geometry  { include "pc(pc104)"   };
};


Edit: Doh! should have mentioned above when posting xorg and evdev stuff. I use xmodmap in .xinitrc to remove Lock from caps lock and add Mod3. Running the above setxkbmap command undoes the xmodmapping, but then re-running the xmodmap modifier switch commands works fine afterward, and vty switching continues to work.

Does anyone have pointers to a different way to do the xmodmap stuff, if doing it in .xinitrc is not the correct way? Will have to comment that out and do some more testing.... grr.... X restarts no fun.
Back to top
View user's profile Send private message
aceFruchtsaft
Guru
Guru


Joined: 16 May 2004
Posts: 438
Location: Vienna, Austria

PostPosted: Wed Oct 28, 2009 7:41 am    Post subject: Reply with quote

This problem kind of resurfaces with the upgrade to Xorg-7.5 / xorg-server-1.7.1. This probably is not related to xf86-input-evdev since I upgraded to version 2.3.0 some days earlier and everything worked.

Now all the usual control sequences work, but they also work w/o pressing CTRL. Also, the input event is passed to the application and handled by the xserver at the same time, i.e. ALT+F2 switches to VT2 and at the same time invokes the run dialog in KDE.

Running setxkbmap changes nothing, and I don't use xmodmap to configure anything, AFAIK.
Back to top
View user's profile Send private message
myceliv
Apprentice
Apprentice


Joined: 29 Nov 2007
Posts: 178

PostPosted: Sun Dec 06, 2009 9:03 pm    Post subject: Reply with quote

Ok, everything except ctrl-alt-backspace is working properly now. But I can live without that now that VTY's work again. Here's what I'm using with xorg-server-1.7.3:

In ~/.xinitrc is [[ -x "/usr/bin/xmodmap" ]] && xmodmap ~/.xmodmaprc. It just removes Lock from Caps_Lock and puts Mod3 on instead. Previously if I used this then vty switching would not work, but ok now, any customizations from 10-keymap.fdi such as gb keymap remain on login.

/etc/X11/xorg.conf
Code:
                                                                                                                                                       
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Option         "Xinerama" "0"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "SUN GDM-5410"
    HorizSync       30.0 - 121.0
    VertRefresh     48.0 - 160.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Mitsubishi"
    ModelName      "Diamond Plus 200"
    HorizSync       30.0 - 121.0
    VertRefresh     48.0 - 160.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8800 GTS"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "TwinViewXineramaInfoOrder" "CRT-0"
    Option         "metamodes" "CRT-0: 1600x1200_75 +0+0, CRT-1: 1600x1200_75 +1600+0"
    SubSection     "Display"
        Depth       24
    EndSubSection

/etc/hal/fdi/policy/10-keymap.fdi (using choices from /usr/share/X11/xkb/rules/xorg.lst)
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keymap">
      <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
    </match>

    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.rules" type="string">base</merge>

      <!-- If we're using Linux, we use evdev by default (falling back to
           keyboard otherwise). -->
      <merge key="input.xkb.model" type="string">keyboard</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.xkb.model" type="string">evdev</merge>
      </match>

      <merge key="input.xkb.layout" type="string">us</merge>
      <merge key="input.xkb.options" type="string">terminate:ctrl_alt_bksp</merge>
    </match>
  </device>
</deviceinfo>

Using the various input.xkb.options for caps lock, like caps:hyper, etc. work fine, and I could use that with some re-arranging of my keybindings to not run xmodmap, but even doing that, still terminate C-A-Backspace doesn't work. It's good enough for now though; have got my C-A-Fn keys back.
Back to top
View user's profile Send private message
myceliv
Apprentice
Apprentice


Joined: 29 Nov 2007
Posts: 178

PostPosted: Mon Dec 07, 2009 2:17 am    Post subject: Reply with quote

With VoidMage's help. (Thanks!) Cutting down to this minimal (since I use "us" anyway) and updating to new syntax the hal.fdi file now has everything working properly. With or without custom xmodmapping now all are good: vty switching and C-A-Backspace to kill the X server.
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbOptions" type="string">terminate:ctrl_alt_bksp</merge>                                                                               
    </match>
  </device>
</deviceinfo>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum