Fwd: [g-a-devel]Request to apply patch for bug #108664 in gnopernicus



We have the attached patch for bug #108664 in gnopernicus. This patch used
to adapt the changes made in at-spi to work a feature which is very
important for gnopernicus. 
Without this feature in gnopernicus can not be activate some feature on 
Solaris and in java applications.
This bug blocks a number of gnopernicus bugs and has been tested by the 
gnopernicus and the at-spi team.

Problem description:
Under Solaris and with java application the numpad keys are not working. This 
patch is a workaround to solve this.

Permission to apply is requested.

Regards
Paul Sprencz
BAUM Engineering



Index: libke.c
===================================================================
RCS file: /cvs/gnome/gnopernicus/kbd_mouse/libke/libke.c,v
retrieving revision 1.53
diff -u -p -r1.53 libke.c
--- libke.c	22 Aug 2003 12:10:52 -0000	1.53
+++ libke.c	1 Sep 2003 07:38:27 -0000
@@ -36,7 +36,7 @@
 
 #include <X11/XKBlib.h>
 
-#undef  USE_ALL_WINDOWS
+#define  USE_ALL_WINDOWS
 
 /* Solaris specific variable types. */
 #ifdef __sun
@@ -538,6 +538,26 @@ ke_return_key (glong keyID)
 	case XK_KP_Subtract:	layer_code = 13; break;
 	case XK_KP_Multiply:	layer_code = 14; break;
 	case XK_KP_Divide:	layer_code = 15; break;
+#ifdef __sun
+	/*
+	 * The KeySyms returned by Solaris Xserver are incorrect.
+	 * The values below are those returned on Solaris.
+	 */
+	case XK_KP_Insert:	layer_code = 0; break;
+	case XK_F33:		layer_code = 1; break;
+	case XK_Down:		layer_code = 2; break;
+	case XK_F35:		layer_code = 3; break;
+	case XK_Left:		layer_code = 4; break;
+	case XK_F31:		layer_code = 5; break;
+	case XK_Right:		layer_code = 6; break;
+	case XK_F27:		layer_code = 7; break;
+	case XK_Up:		layer_code = 8; break;
+	case XK_F29:		layer_code = 9; break;
+	case XK_KP_Delete:	layer_code = 10; break;
+	case XK_F24:		layer_code = 13; break;
+	case XK_F26:		layer_code = 14; break;
+	case XK_F25:		layer_code = 15; break;
+#endif
 	default:
 	break;
     }		
@@ -1337,6 +1357,90 @@ ke_layer_register_events (AccessibleKeys
 				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
     ke_print_register_return_value (retval, "(B1|B2|B3|NUMLOCK)");
 #endif
+
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif
+
+    ke_print_register_return_value (retval, "(NUMLOCK)");
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_SHIFTLOCK|SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif
+    ke_print_register_return_value (retval, "(SL|NUMLOCK)");
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_SHIFT|SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif
+    ke_print_register_return_value (retval, "(S|NUMLOCK)");
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_ALT|SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS				
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif
+    ke_print_register_return_value (retval, "(S|NUMLOCK)");
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_CONTROL|SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif				      
+    ke_print_register_return_value (retval, "(C|NUMLOCK)");
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_ALT|SPI_KEYMASK_SHIFT|SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif				      
+    ke_print_register_return_value (retval, "(A|S|NUMLOCK)");
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_CONTROL|SPI_KEYMASK_SHIFT|SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif
+    ke_print_register_return_value (retval, "(C|S|NUMLOCK)");
+    retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
+				      (AccessibleKeySet *) ke_layer_keyset,
+				      SPI_KEYMASK_CONTROL|SPI_KEYMASK_ALT|SPI_KEYMASK_MOD3,
+				      (gulong) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+#ifdef USE_ALL_WINDOWS
+				      SPI_KEYLISTENER_ALL_WINDOWS);
+#else
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+#endif
+    ke_print_register_return_value (retval, "(C|A|NUMLOCK)");
+    
+
     retval = SPI_registerAccessibleKeystrokeListener (ke_layer_listener,
 				      (AccessibleKeySet *) ke_layer_keyset,
 				      SPI_KEYMASK_MOD2,
@@ -1421,6 +1525,7 @@ ke_layer_register_events (AccessibleKeys
     
     return retval;
 }
+
 static gboolean
 ke_keyecho_register_events (AccessibleKeystrokeListener *ke_key_listener,
 			    AccessibleKeySet 	        *ke_key_keyset)
@@ -1434,6 +1539,22 @@ ke_keyecho_register_events (AccessibleKe
     */
     retval = SPI_registerAccessibleKeystrokeListener (ke_key_listener,
 				      (AccessibleKeySet *) ke_key_keyset,
+				      SPI_KEYMASK_BUTTON1,
+				      (gulong) (SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+    retval = SPI_registerAccessibleKeystrokeListener (ke_key_listener,
+				      (AccessibleKeySet *) ke_key_keyset,
+				      SPI_KEYMASK_BUTTON2,
+				      (gulong) (SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+    retval = SPI_registerAccessibleKeystrokeListener (ke_key_listener,
+				      (AccessibleKeySet *) ke_key_keyset,
+				      SPI_KEYMASK_BUTTON3,
+				      (gulong) (SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
+				      
+    retval = SPI_registerAccessibleKeystrokeListener (ke_key_listener,
+				      (AccessibleKeySet *) ke_key_keyset,
 				      SPI_KEYMASK_UNMODIFIED,
 				      (gulong) (SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
 				      SPI_KEYLISTENER_NOSYNC | SPI_KEYLISTENER_CANCONSUME);
@@ -1768,6 +1889,35 @@ ke_user_key_list_unregister_events (void
 static void 
 ke_layer_unregister_events (void)
 {
+#ifndef USE_ALL_WINDOWS
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_BUTTON1 |
+					    SPI_KEYMASK_MOD2);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_BUTTON2 |
+					    SPI_KEYMASK_MOD2);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_BUTTON3 |
+					    SPI_KEYMASK_MOD2);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_BUTTON1 |
+					    SPI_KEYMASK_BUTTON2 |
+					    SPI_KEYMASK_MOD2);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_BUTTON1 |
+					    SPI_KEYMASK_BUTTON3 |
+					    SPI_KEYMASK_MOD2);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_BUTTON2 |
+					    SPI_KEYMASK_BUTTON3 |
+					    SPI_KEYMASK_MOD2);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_BUTTON1 |
+					    SPI_KEYMASK_BUTTON2 |
+					    SPI_KEYMASK_BUTTON3 |
+					    SPI_KEYMASK_MOD2);
+#endif
+
     SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
 					    SPI_KEYMASK_MOD2);
     SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
@@ -1794,12 +1944,45 @@ ke_layer_unregister_events (void)
 					    SPI_KEYMASK_MOD2  | 
 					    SPI_KEYMASK_SHIFT |
 					    SPI_KEYMASK_ALT);
+
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3 | 
+					    SPI_KEYMASK_SHIFTLOCK);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3 | 
+					    SPI_KEYMASK_SHIFT);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3 | 
+					    SPI_KEYMASK_ALT);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3 | 
+					    SPI_KEYMASK_CONTROL);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3  | 
+					    SPI_KEYMASK_SHIFT |
+					    SPI_KEYMASK_CONTROL);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3  | 
+					    SPI_KEYMASK_ALT   |
+					    SPI_KEYMASK_CONTROL);
+    SPI_deregisterAccessibleKeystrokeListener (ke_layer_listener, 
+					    SPI_KEYMASK_MOD3  | 
+					    SPI_KEYMASK_SHIFT |
+					    SPI_KEYMASK_ALT);
 }
 
 static void
 ke_keyecho_unregister_events (void)
 {
     /* deregister keylisteners */
+    SPI_deregisterAccessibleKeystrokeListener (ke_keyecho_listener, 
+					    SPI_KEYMASK_BUTTON1);
+    SPI_deregisterAccessibleKeystrokeListener (ke_keyecho_listener, 
+					    SPI_KEYMASK_BUTTON2);
+    SPI_deregisterAccessibleKeystrokeListener (ke_keyecho_listener, 
+					    SPI_KEYMASK_BUTTON3);
     SPI_deregisterAccessibleKeystrokeListener (ke_keyecho_listener, 
 					    SPI_KEYMASK_UNMODIFIED );
     SPI_deregisterAccessibleKeystrokeListener (ke_keyecho_listener, 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]