2003-12-11 Padraig O'Briain <padraig.obriain@sun.com>
authorpadraigo <padraigo@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 11 Dec 2003 18:30:19 +0000 (18:30 +0000)
committerpadraigo <padraigo@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 11 Dec 2003 18:30:19 +0000 (18:30 +0000)
* registryd/devieceventcontroller.c (spi_dec_translate_mask):
Allow for mask to contain values other than NumLock mask.
Fixes bug #129103.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@577 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
registryd/deviceeventcontroller.c

index 31d7645..23a5adc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-11  Padraig O'Briain <padraig.obriain@sun.com>
+
+       * registryd/devieceventcontroller.c (spi_dec_translate_mask):
+       Allow for mask to contain values other than NumLock mask.
+       Fixes bug #129103.
+
 2003-12-10  Padraig O'Briain <padraig.obriain@sun.com>
 
        * registryd/devieceventcontroller.c:
index 41e616a..e75885d 100644 (file)
@@ -570,17 +570,25 @@ spi_dec_init_mouse_listener (SpiRegistry *registry)
 /**
  * Eventually we can use this to make the marshalling of mask types
  * more sane, but for now we just use this to detect 
- * the use of 'virtual' masks such as Mumlock and convert them to
+ * the use of 'virtual' masks such as numlock and convert them to
  * system-specific mask values (i.e. ModMask).
  * 
  **/
 static Accessibility_ControllerEventMask
 spi_dec_translate_mask (Accessibility_ControllerEventMask mask)
 {
-  if (mask == SPI_KEYMASK_NUMLOCK) {
-    mask = _numlock_physical_mask;
-  }
-  return mask;
+  Accessibility_ControllerEventMask tmp_mask;
+  gboolean has_numlock;
+
+  has_numlock = (mask & SPI_KEYMASK_NUMLOCK);
+  tmp_mask = mask;
+  if (has_numlock)
+    {
+      tmp_mask = mask ^ SPI_KEYMASK_NUMLOCK;
+      tmp_mask |= _numlock_physical_mask;
+    }
+
+  return tmp_mask;
 }
 
 static DEControllerKeyListener *