Re: Virtual Console switching:

2005-10-31 Thread Yedidyah Bar-David
On Mon, Oct 31, 2005 at 01:46:14PM +0200, Ilya Konstantinov wrote:
> On ב', 2005-10-31 at 10:32 +0200, Shachar Shemesh wrote:
> > The X case may be different (I don't know). X grabs the alt-Fx
> > combination from the kernel, and gives it ctrl-alt-Fx instead. I'm not
> > sure whether that's a user space thing or a kernel thing.
> 
> Alt-Fx switching at the textual console is managed by the kernel but
> user-configurable as part of the console keyboard mapping. Run
> 'dumpkeys' and look for the Console_1, Console_2 etc. mappings.
> 
> Alt-Ctrl-Fx switch is entirely userspace. By merit of running as root, X
> can switch the console into Raw Keyboard Mode, which means it intercepts
> scancodes directly and avoids Linux keyboard keycodes and mapping. The
> magic that makes Alt-Ctrl-Fx work is the XKB mapping into
> XF86_Switch_VT_1 psuedo-keysyms --
> see /usr/X11R6/lib/X11/xkb/symbols/srvr_ctrl.
> 
> To find out how X does what it does programatically, try strace'ing
> chvt.

Or read the manpage console_ioctl(4).
-- 
Didi


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Virtual Console switching:

2005-10-31 Thread Ilya Konstantinov
On ב', 2005-10-31 at 10:32 +0200, Shachar Shemesh wrote:
> The X case may be different (I don't know). X grabs the alt-Fx
> combination from the kernel, and gives it ctrl-alt-Fx instead. I'm not
> sure whether that's a user space thing or a kernel thing.

Alt-Fx switching at the textual console is managed by the kernel but
user-configurable as part of the console keyboard mapping. Run
'dumpkeys' and look for the Console_1, Console_2 etc. mappings.

Alt-Ctrl-Fx switch is entirely userspace. By merit of running as root, X
can switch the console into Raw Keyboard Mode, which means it intercepts
scancodes directly and avoids Linux keyboard keycodes and mapping. The
magic that makes Alt-Ctrl-Fx work is the XKB mapping into
XF86_Switch_VT_1 psuedo-keysyms --
see /usr/X11R6/lib/X11/xkb/symbols/srvr_ctrl.

To find out how X does what it does programatically, try strace'ing
chvt.


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Virtual Console switching:

2005-10-31 Thread Shachar Shemesh
Rafi Gordon wrote:

> Hi,
>   On my fedora core 3 , running alt/ctrl/f2 changes to virtual console
> number 2.(According to /etc/inittab, there are 6 virtual consoles).
> 
> My question is : how is it done ? what is the chain of actions (or
> maybe single action) which alt/ctrl/f2 initiates ?

No chain. The entire virtual consoles setup, including the terminal
emulation you get (escape sequences changing colors etc. in text mode)
is handled by the kernel. It is also the one responsible for the fact
that, when you press "alt-f1" you switch to virtual console 1.

The X case may be different (I don't know). X grabs the alt-Fx
combination from the kernel, and gives it ctrl-alt-Fx instead. I'm not
sure whether that's a user space thing or a kernel thing.

> On the FC3 keyboard shortcuts dialog window, the combination
> alt/ctrl/fn (n < 6)
> does not appear at all.

I don't know FC3, but I'm fairly sure that the dialog you refer to
configures KDE or Gnome, and not X. What we're talking about here is
either an X thing or a kernel thing - outside the scope of said dialog.

> (It of course has to do to mingetty , which is what appears in
> the /etc/inittab:
> 2:2345:respawn:/sbin/mingetty tty2.

No, mingetty has (almost) nothing to do with it. mingetty opens
/dev/tty2, which tells the kernel that virtual console 2 is needed, and
causes it to create such a thing. The actual switching is handled, as
mentioned earlier, by the kernel.

> But again, my question is : what exactly is the action
> which it triggers in order to switch to the virtual console?)

It may prove instructive for you to RTFM "chvt". Caveat - it needs to
run as root. Try running "chvt 1" as root (from your X session).

> Regards,
> RG



-- 
Shachar Shemesh
Lingnu Open Source Consulting ltd.
Have you backed up today's work? http://www.lingnu.com/backup.html


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Virtual Console switching:

2005-10-31 Thread Yedidyah Bar-David
On Mon, Oct 31, 2005 at 09:42:26AM +0200, Rafi Gordon wrote:
> Hi,
> On my fedora core 3 , running alt/ctrl/f2 changes to virtual console
> number 2.(According to /etc/inittab, there are 6 virtual consoles).
> 
> My question is : how is it done ? what is the chain of actions (or
> maybe single action) which alt/ctrl/f2 initiates ?
> 
> On the FC3 keyboard shortcuts dialog window, the combination alt/ctrl/fn (n
> < 6)
> does not appear at all.
> 
> (It of course has to do to mingetty , which is what appears in
> the /etc/inittab:
> 2:2345:respawn:/sbin/mingetty tty2.
> 
> But again, my question is : what exactly is the action
> which it triggers in order to switch to the virtual console?)

It's done by the X server directly, not by any client (such as KDE etc).
Read 'man XFree86' and search for 'ctrl'.
-- 
Didi


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Virtual Console switching:

2005-10-30 Thread Rafi Gordon
Hi,
  On my fedora core 3 , running alt/ctrl/f2 changes to virtual console
    number 2.(According to /etc/inittab, there are 6 virtual consoles).
    
    My question is : how is it done ? what is the chain of actions (or 
    maybe single action) which alt/ctrl/f2 initiates ? 
    
    On the FC3 keyboard shortcuts dialog window, the combination alt/ctrl/fn (n < 6)
    does not appear at all.
    
    (It of course has to do to mingetty , which is what appears in 
    the /etc/inittab:
    2:2345:respawn:/sbin/mingetty tty2.
    
    But again, my question is : what exactly is the action 
    which it triggers in order to switch to the virtual console?)
    
    Regards,
    RG