[AD] Accessing X internals

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi

I made a patch about a week ago in order to access the internals
of the X system -- in particular I needed a few things from the
_xwin variable, and to intercept the window creation calls.
Does anyone have any comments on the patch?  Can it be included?
I've only put in exactly what I needed; for more general use
other things might be wanted, and I don't know whether Michael
already has some idea how he wants to handle this sort of thing.
We're also not installing platform-specific headers in the Unix
makefile; not a problem usually since `linalleg.h' is pretty
useless and until this patch `xalleg.h' doesn't exist.  If we do
incorporate this patch, we can add the installation code too.

The patch attached is the same as the patch I posted to another
list last week, but updated for Allegro 3.9.29.

George

diff -urN all3929-9/src/linux/lkeybd.c all3929-10/src/linux/lkeybd.c
--- all3929-9/src/linux/lkeybd.c	Sun Dec 12 21:51:26 1999
+++ all3929-10/src/linux/lkeybd.c	Sun Dec 19 00:40:16 1999
@@ -391,13 +391,20 @@
 
 static void linux_key_exit (void)
 {
+	/* Reset LED mode before exiting */
+	ioctl(std_keyboard.fd, KDSETLED, 8);
+
         __al_linux_remove_standard_driver (&std_keyboard);
         close (std_keyboard.fd);
 }
 
 static void linux_set_leds (int leds)
 {
-        ioctl(std_keyboard.fd, KDSETLED, leds & 7);
+	int val = 0;
+	if (leds & KB_SCROLOCK_FLAG) val |= LED_SCR;
+	if (leds & KB_NUMLOCK_FLAG) val |= LED_NUM;
+	if (leds & KB_CAPSLOCK_FLAG) val |= LED_CAP;
+        ioctl(std_keyboard.fd, KDSETLED, val);
 }
 
 static void linux_set_rate (int delay, int rate)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/