summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon/gnome-settings-keyboard.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2002-01-08 21:03:07 +0000
committerJonathan Blandford <jrb@src.gnome.org>2002-01-08 21:03:07 +0000
commitd317e2704e5aa76ae0c85eb5746f6e0f3e6f3f8a (patch)
tree0ef452d0bcad6909c8dd8d1ffbf062260824e684 /gnome-settings-daemon/gnome-settings-keyboard.c
parentbb15c09c1db4376165eca04e8592ba947749d0d9 (diff)
downloadgnome-control-center-d317e2704e5aa76ae0c85eb5746f6e0f3e6f3f8a.tar.gz
Add locate-pointer. Initial attempt at locate-pointer. Don't understand
Tue Jan 8 15:50:59 2002 Jonathan Blandford <jrb@redhat.com> * Makefile.am: Add locate-pointer. * gnome-settings-keyboard.c: Initial attempt at locate-pointer. Don't understand XKB enough to figure it out. * gnome-settings-locate-pointer.[ch]: Draw the locate pointer box. Pretty snazzy for a useless (but fun) feature. * gnome-settings-mouse.c: Move locate pointer to it's own file. Tue Jan 8 15:49:15 2002 Jonathan Blandford <jrb@redhat.com> * .cvsignore: update * Makefile.am: Add gnome-keyboard-properties.c * gnome-keyboard-properties.c: New, much nicer capplet. * gnome-keyboard-properties.glade: glade file for above. * keyboard-bell.png: * keyboard-cursor.png: * keyboard-repeat.png: * keyboard-volume.png: Images for above. Note, keyboard-cursor.png is my pathetic attempt at artwork, and will prolly change in the future. Tue Jan 8 15:47:24 2002 Jonathan Blandford <jrb@redhat.com> * .cvsignore: New ignores. * gnome-mouse-properties.glade: Update of glade file for cursors * mouse-cursor-normal-large.png: New images * mouse-cursor-normal.png: * mouse-cursor-white-large.png: * mouse-cursor-white.png: * mouse-properties-capplet.c: (setup_dialog), (create_dialog), (main): Add support for new properties. Don't fully work yet, but we'll get it later. * mouse-properties.glade: not sure what changed -- need to remove this file.
Diffstat (limited to 'gnome-settings-daemon/gnome-settings-keyboard.c')
-rw-r--r--gnome-settings-daemon/gnome-settings-keyboard.c57
1 files changed, 56 insertions, 1 deletions
diff --git a/gnome-settings-daemon/gnome-settings-keyboard.c b/gnome-settings-daemon/gnome-settings-keyboard.c
index 997bd883a..bd928064a 100644
--- a/gnome-settings-daemon/gnome-settings-keyboard.c
+++ b/gnome-settings-daemon/gnome-settings-keyboard.c
@@ -32,11 +32,20 @@
#include "gnome-settings-keyboard.h"
#include "gnome-settings-daemon.h"
+#include "gnome-settings-locate-pointer.h"
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
# include <X11/extensions/xf86misc.h>
#endif
+#define HAVE_XKB
+#ifdef HAVE_XKB
+# include <X11/XKBlib.h>
+#endif
+
+static gboolean use_xkb = FALSE;
+static gint xkb_event_type = 0;
+
static void
apply_settings (void)
{
@@ -58,7 +67,7 @@ apply_settings (void)
click = gconf_client_get_bool (client, "/gnome/desktop/peripherals/keyboard/click", NULL);
rate = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/rate", NULL);
delay = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/delay", NULL);
- volume = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/volume", NULL);
+ volume = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/click_volume", NULL);
bell_volume = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/bell_volume", NULL);
bell_pitch = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/bell_pitch", NULL);
bell_duration = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/bell_duration", NULL);
@@ -93,10 +102,56 @@ apply_settings (void)
&kbdcontrol);
}
+#ifdef HAVE_XKB
+/* XKB support
+ */
+static GdkFilterReturn
+gnome_settings_keyboard_xkb_filter (GdkXEvent *xevent,
+ GdkEvent *event,
+ gpointer data)
+{
+ if (((XEvent *) xevent)->type == xkb_event_type) {
+ XkbEvent *xkb_event = (XkbEvent *)xevent;
+ if (xkb_event->any.xkb_type == XkbStateNotify) {
+ /* gnome_settings_locate_pointer (); */
+ }
+ }
+ return GDK_FILTER_CONTINUE;
+}
+#endif
+
+static void
+gnome_settings_keyboard_init_xkb (void)
+{
+#ifdef HAVE_XKB
+ gint xkb_major = XkbMajorVersion;
+ gint xkb_minor = XkbMinorVersion;
+ g_print ("foo1\n");
+ if (XkbLibraryVersion (&xkb_major, &xkb_minor)) {
+ xkb_major = XkbMajorVersion;
+ xkb_minor = XkbMinorVersion;
+ g_print ("foo2\n");
+
+ if (XkbQueryExtension (gdk_display, NULL, &xkb_event_type, NULL,
+ &xkb_major, &xkb_minor)) {
+ g_print ("foo3\n");
+ XkbSelectEvents (gdk_display,
+ XkbUseCoreKbd,
+ XkbMapNotifyMask | XkbStateNotifyMask,
+ XkbMapNotifyMask | XkbStateNotifyMask);
+ gdk_window_add_filter (NULL, gnome_settings_keyboard_xkb_filter, NULL);
+ }
+ }
+#endif
+}
+
+
+
void
gnome_settings_keyboard_init (GConfClient *client)
{
gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/keyboard", (KeyCallbackFunc) apply_settings);
+ gnome_settings_keyboard_init_xkb ();
}
void