That's beyond the scope of what I'm doing, but it's certainly possible.
Right now I'm just trying to improve the interface between the XFree86 ddx
and the XKB extension so that the latter can handle the various special
key sequences that the former has be doing itself.  In other words, I'm
trying to get XKB to do the handling of things like Ctrl-Alt-Bksp, Ctrl-Alt-+,
and Ctrl-Alt-F1, etc. By doing so, it becomes possible to change exactly
which key sequence activates the various actions (terminate server, switch
video mode, switch VT) by simply editing a keymap file rather than having
to modify the server's source code and recompile.

You're right that the video drivers can't intercept keyboard (or mouse)
events.  However, the common layer can and it can make calls into the
video drivers, which is how mode switching with Ctrl-Alt-<Plus> and
Ctrl-Alt-<Minus> is currently implemented.  A similar thing could be
done for getting the driver to switch where the board's signal is being
output.

You should be able to do it right now by making xf86Events.c call your
driver's function when a certain key sequence is pressed.

Making a generic method by which you could send an arbitrary string
(defined in a keymap) to a driver does seem like a flexible method for
handling this sort thing though, so maybe I'll look into it when I finish
some current projects.

> 
> while you are at it: Would it be possible to implement some sort of
> generic/custom key combination (of your choice) to be used by video
> drivers, such as a replacement of the Fn-combination found on many
> laptops? 
> 
> I am facing the following problem: On SiS based machines, the
> Fn-combination for switching between LCD, TV and VGA in many cases does
> not work. If it works, it messes up the registers without "letting" the
> video driver "know". I would like to implement the switch-LCD-TV-VGA
> function into the video driver (in fact, the function is already there,
> but unused) but so far I haven't found a way to intercept keyboard
> events from within a video driver.
> 
> Just my $.2
> 
> Thomas
> 
> 
> [EMAIL PROTECTED] wrote:
> > 
> > > David Dawes writes:
> > >
> > > >On Thu, Oct 17, 2002 at 02:29:19PM -0700, Mark Vojkovich wrote:
> > > [...]
> > >
> > > > It'd be nice to make this configurable, and I'm sure that a patch
> > > > to do that would be welcome.
> > > >
> > > > >  There may be other ways to do this via configuring the XKB
> > > > >extension.  But I know next to nothing about XKB.
> > > >
> > > > It's currently intercepting key events before they get passed up out of
> > > > the DDX.  I'm not sure how feasible it would be to intercept them after
> > > > they've been converted into X keysyms, but that might offer a more
> > > > configurable solution.
> > >
> > > XKB definately has support for defining "action" keys (e.g. to switch VTs or
> > > to kill the server) and the mappings are, of course, configurable.  I thought
> > > I had submitted a patch long ago to enable this functionality in XFree86, but
> > > I guess I never sent it in.  I'll see if I can find it in my archives.
> > 
> > I didn't find it, so I rewrote it.  This is better way of implementing
> > than I did it before anyway.
> > 
> > The attached patch:
> >         1) Creates a new function to process action events that can be called
> >            both by the current code (in xf86Events.c) that intercepts special
> >            key sequences and by XKEYBOARD's action handlers.
> >         2) Implements handling the processing of the Terminate action
> >         3) Updates the xkb symbol maps to have a default mapping for the
> >            Ctrl-Alt-Backspace sequence to the Terminate action
> > 
> > I'll send a patch implementing other special keys in XKB as soon as I write it.
> > 
> 
> -- 
> Thomas Winischhofer
> Vienna/Austria
> mailto:thomas@;winischhofer.net          *** http://www.winischhofer.net
> _______________________________________________
> Xpert mailing list
> [EMAIL PROTECTED]
> http://XFree86.Org/mailman/listinfo/xpert
> 

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to