/* deviceeventcontroller.c: implement the DeviceEventController interface */
-#include <config.h>
+#include "config.h"
#undef SPI_XKB_DEBUG
#undef SPI_DEBUG
#include <dbus/dbus.h>
#include "paths.h"
-#include "keymasks.h"
#include "de-types.h"
#include "de-marshaller.h"
+#include "keymasks.h"
+
#ifdef HAVE_X11
#include "display.h"
#include "event-source.h"
gint y;
};
typedef struct _SpiPoint SpiPoint;
+
static unsigned int mouse_mask_state = 0;
-#ifdef HAVE_X11
static unsigned int key_modifier_mask =
- Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask | ShiftMask | LockMask | ControlMask | SPI_KEYMASK_NUMLOCK;
-static unsigned int _numlock_physical_mask = Mod2Mask; /* a guess, will be reset */
-#else
-static unsigned int key_modifier_mask = 255;
-static unsigned int _numlock_physical_mask = (1<<4);
-#endif
+ SPI_KEYMASK_MOD1 | SPI_KEYMASK_MOD2 | SPI_KEYMASK_MOD3 | SPI_KEYMASK_MOD4 |
+ SPI_KEYMASK_MOD5 | SPI_KEYMASK_SHIFT | SPI_KEYMASK_SHIFTLOCK |
+ SPI_KEYMASK_CONTROL | SPI_KEYMASK_NUMLOCK;
+static unsigned int _numlock_physical_mask = SPI_KEYMASK_MOD2; /* a guess, will be reset */
static gboolean have_mouse_listener = FALSE;
static gboolean have_mouse_event_listener = FALSE;
SpiDEControllerClass *klass;
klass = SPI_DEVICE_EVENT_CONTROLLER_GET_CLASS (controller);
if (klass->plat.emit_modifier_event)
- return klass->plat.emit_modifier_event (controller, prev_mask, current_mask);
+ klass->plat.emit_modifier_event (controller, prev_mask, current_mask);
}
static void
SpiDEControllerClass *klass;
klass = SPI_DEVICE_EVENT_CONTROLLER_GET_CLASS (controller);
if (klass->plat.generate_mouse_event)
- return klass->plat.generate_mouse_event (controller, x, y, eventName);
+ klass->plat.generate_mouse_event (controller, x, y, eventName);
}
DBusMessage *
grab_mask.mod_mask = key_listener->mask;
if (g_slist_length (key_listener->keys) == 0) /* special case means AnyKey/AllKeys */
{
-#ifdef HAVE_X11
- grab_mask.key_val = AnyKey;
-#else
- grab_mask.key_val = 0L;
-#endif
-
+ grab_mask.key_val = 0L; /* AnyKey */
#ifdef SPI_DEBUG
fprintf (stderr, "AnyKey grab!");
#endif
* in our arg list; it can contain either
* a keycode or a keysym.
*/
-#ifdef HAVE_X11
- spi_dec_synth_keysym (controller, (KeySym) keycode);
-#else
- spi_dec_synth_keysym (controller, (long) keycode);
-#endif
+ spi_dec_synth_keysym (controller, keycode);
break;
case Accessibility_KEY_STRING:
if (!spi_dec_plat_synth_keystring (controller, synth_type, keycode, keystring))
fprintf (stderr, "Keystring synthesis failure, string=%s\n",
keystring);
break;
+ case Accessibility_KEY_LOCKMODIFIERS:
+ spi_dec_plat_lock_modifiers (controller, keycode);
+ break;
+ case Accessibility_KEY_UNLOCKMODIFIERS:
+ spi_dec_plat_unlock_modifiers (controller, keycode);
+ break;
}
reply = dbus_message_new_method_return (message);
return reply;