LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't switch to virtual console (from gnome) (http://www.linuxquestions.org/questions/linux-newbie-8/cant-switch-to-virtual-console-from-gnome-133112/)

NumbThumb 01-09-2004 01:14 PM

Can't switch to virtual console (from gnome)
 
hello everybody.

I have the following problem: I can't switch to a virtual console when loged into gnome (actually, i havn't tried from KDE).
Ctrl-Alt-F1, etc simply does nothing.

Is it possible this is turned off somewhere? Or is something seriously b0rken? How can I find out? Is there an alternative way to switch?

please help :cry:

Oh, i nearly forgot:
I'm running Gnome 2.2.0 on a RedHat 9 System. The WM is metacity (gnome default). Keyboard-Layout is German-NoDeadKeys.

thanx in advance...

DrOzz 01-09-2004 01:49 PM

well did you try others such as ctrl-alt-f2 through to f6?
or is it just on f1?

fancypiper 01-09-2004 01:56 PM

Are you are holding control and alt down firmly when you hit the F1 key?

NumbThumb 01-09-2004 02:16 PM

yes, i tried...
 
yes i did try all keys (CTRL-ALT-F1 through F6), and yes i held down the keys FIRMLY and long. I even tried the other ctrl/alt keys (right side). Nothing.

Also, i have the same problem on my laptop (same distro). But there it worked once or twice... The thing is i usually only try that only when X or Gnome has barfed -- so maybe it worked sometimes because whatever causes it not to work had just crashed ?...

My suspicion is that something captures those key-events and does not forward them correctly (or not at all). What would be the possibilities here?

Oh, BTW: Ctrl- and Alt-Keys seem to work as expected for other programs, so a messed-up keyboard-layout should not be the cause, i think.

do you have any suggestion where i could start to look?

lugoteehalt 01-09-2004 02:44 PM

Quote:

My suspicion is that something captures those key-events and does not forward them correctly (or not at all). What would be the possibilities here?
If you were using fvwm2, which you are not, then numlock might cause the problem you describe. Perhaps try numlocking/unnumlocking??:)

NumbThumb 01-09-2004 03:42 PM

nope, NUMLOCk is not it...
 
i tried pressing NUMLOCK, then CTRL-ALT-F4, then NUMLOCK again, the CTRL-ALT-F4 again... nothin. It even seems that NUMLOCK is disabled completele: The LED stays off an when i type, i allways get numbers. That's a little strage, but fine with me... who needs the Naviagion-Function of the numpad anyway?

(actually, i've long been searching for a Keyboard without a numpad, but with the Kursor-Keys etc in the right place. WOuld give me more root for the mouse...)

thanks anyway...

hmmm... this seems thougher than i thought. Where else could i ask my question? oh, and btw: i heard rumores about the virtual-console-switching being turned off in some distros becausee "it confuses the user". I wasn't able to confirm that, though... any idea about redhat?

chears... :confused:

lugoteehalt 01-10-2004 07:13 AM

Another possibility is of course that the runlevel you are in does not have tty1 etc. consoles. If this is possibility could look in ?inittab - the basic init file - to find a suitable run-level to switch to. If none exists then edit inittab.

If numlock not working could that mean the keyboard is incorrectly set up - so when press 'ctrl-alt-Fn' the computer gets 'not all swans are white'?:)

NumbThumb 01-10-2004 08:47 AM

OOPS...
 
My Repost of this just got Closed by a mod for being just that -- a repost. Sorry, i didn't mean to spam you, i just thought the topic meight be RedHat-specific so i posted in the RedHat forum. Next time i'll just rephrase and not back-link ;)

chears and all

NumbThumb 01-10-2004 09:04 AM

/etc/inittab
 
in reply to howzit:

Thanks for another place to look... but /etc/inittab does not seem to be the problem either. Here is an excerpt:
Quote:

# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
Looks fine, no? Also, calling "/sbin/mingetty tty2" manually has no effect.

:eek: I just noticed: hitting CTRL-ALT-F1 (F2, etc) in a gnome-terminal results in the character-sequence ";7~"... that should not happen, right? That keystroke should never reach the console? Oh, when i try this in Konsole, I get [23~ for CTRL-ALT-F1 and [24~ for C-A-F2, but nothing for the other Fs. strange....

thanks again for the starting point, i'll now google for "inittab"... :)

unSpawn 01-10-2004 10:30 AM

Open an xterm, Konsole or whatever it's called and execute "xev|grep x0.*key". Press these keys after the other: CTRL, ALT, F1, then close the white Xev screen. Now run "xmodmap -pke|egrep -ie "alt|contr"". Please post output from both commands, they should show your keytable mapping for these particular keys.

Shachaf 01-10-2004 10:46 AM

Try typing switchto 1 as root.

NumbThumb 01-10-2004 11:00 AM

xev / xmodmap
 
ok, here goes:

xev|grep x0.*key
state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
state 0x0, keycode 68 (keysym 0xffbf, F2), same_screen YES,
state 0x0, keycode 68 (keysym 0xffbf, F2), same_screen YES,
state 0x0, keycode 69 (keysym 0xffc0, F3), same_screen YES,
state 0x0, keycode 69 (keysym 0xffc0, F3), same_screen YES,
state 0x0, keycode 70 (keysym 0xffc1, F4), same_screen YES,
state 0x0, keycode 70 (keysym 0xffc1, F4), same_screen YES,
state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
state 0x0, keycode 72 (keysym 0xffc3, F6), same_screen YES,
state 0x0, keycode 72 (keysym 0xffc3, F6), same_screen YES,
X connection to :0.0 broken (explicit kill or server shutdown).


(why are all the F-Keys doublicated?)

xmodmap -pke|egrep -ie "alt|contr|= F[1-6] "
keycode 37 = Control_L
keycode 64 = Alt_L Meta_L
keycode 67 = F1 F11
keycode 68 = F2 F12
keycode 69 = F3 F13
keycode 70 = F4 F14
keycode 71 = F5 F15
keycode 72 = F6 F16
keycode 109 = Control_R


...seems fine to me...

BTW: Ctrl-Alt-Backspace does not work either, Ctrl-Alt-Del however does work as specified in inittab (shows a gui-dialog prompting for logout/shoutdown).

Oh, and yes: mingetty is running on tty1-tty6 and "cat /dev/vcs1" etc works fine.

My only idea is that X does not handle Ctrl-Alt-F? as expected. Where would i configure X to handle those keys?

thanks for your help :)

NumbThumb 01-10-2004 11:08 AM

switchto
 
Ok, i had to install the "open" package first, but "switchto 1" works as expected. Going back to X with ALT-F7 also works.

The bad thing is that in case i really need the VC (that is, X has barfed), i won't be able to type that command... considering that CTRL-ALT-BACKSPACE is also broken, i'll be rebooting just to get rid of a broken X :(

thanks anyway, i always wondered how to switch to a VC from a script (in case i would ever need that... never mind).

NumbThumb 01-10-2004 09:35 PM

FOUND THE PROBLEM !!!
 
All the hassle was caused by the KGB: This #!&* piece of crap of an applet monitors the keyboard to change the layout on special keystrokes. An this somehow breaks the CTRL-ALT-F? thingy.

Wow. Would have thought someone had noticed by now... I'm going to file a bugreport with the KGB folx.

OK, i can relax now... :cool: thank you all for your time....

NumbThumb 01-11-2004 12:51 PM

more details
 
i just found the problem with the Gnome KeyBoard-Applet. Thanks to Shooby (author of the Applet) for a quick response (although it did not lead me to the solution). I was a little unfriendly about his Applet, as i though it was stealing the keystrokes itself. In fact it seems that the applet just cause a faulty layout to be loaded -- not the fault of the applet (or its author):o. I still don't understand the details, but here is what i found out:

The problem does not occur if i use setxkbmap for switching kb-layouts -- that is, the problem is somehow related to gkb_xmmap. I probably have a hose layout-file somewhere...

you can see the difference by typing "xmodmap":

BAD version:
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x6d)
mod1 Alt_L (0x40)
mod2 Mode_switch (0x71), Mode_switch (0x74)
mod3
mod4 Select (0x73), Mode_switch (0x74)
mod5 Mode_switch (0x71)


GOOD version:
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x6d)
mod1 Alt_L (0x40)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x73), Super_R (0x74)
mod5 ISO_Level3_Shift (0x71)



i hope this will help someone having a similar problem. :)


All times are GMT -5. The time now is 10:57 PM.