[g-a-devel] generateKeyboardEvent Patch for Java Access Bridge



Hi, 

I am writing an java gnome app that needs to generate keyboard events
and I noticed that the generateKeyboardEvent method in the Java Access
Bridge is left blank. I have written a small patch that enables this
functionality and can be found attached to this email. If you prefer I
can open a bug and post this patch in bugzilla.

I have noticed a couple of other issues. It appears that
java-access-bridge/impl/org/GNOME/Bonobo/UnknownImpl.java is not utf-8
encoded and has special characters in it. This can cause problems with
some jvm's. For me to build the java access bridge, I either have to
remove the special characters or change the encoding to utf-8.

Also, I have noticed that there doesn't seem to be any way to get the
keycodes or keysyms for a specific character in the java access
bridge. I can though get keysyms through java gnome
(org.gnu.gdk.KeySymbol), but I don't can't figure out how to get
keycodes (other than hardcoding then). If I am not missing an obvious
way to do this, I may be willing to help implement this functionality
if you want.

If you have any questions please let me know.

Thanks,

Matt Wringe
diff -u -r ../cvs/java-access-bridge/registry/Makefile.am java-access-bridge/registry/Makefile.am
--- ../cvs/java-access-bridge/registry/Makefile.am	2003-05-09 03:50:37.000000000 -0400
+++ java-access-bridge/registry/Makefile.am	2005-03-15 23:23:37.000000000 -0500
@@ -1,12 +1,17 @@
 SUBDIRS=org
-JAVA_SRC=$(wildcard *.java)
-CLASSES=$(patsubst %.java,%.class,$(JAVA_SRC))
+JARFILES=../gnome-java-bridge.jar
+CLASSES=$(wildcard org/GNOME/*/*.class)
+JAVA_FILES=$(wildcard org/GNOME/*/*.java)
+DEP_CLASSES=$(JAVA_FILES:.java=.class)
 
-all-local: $(CLASSES)
+jar-stamp: ../jar-stamp
+	echo
 
-%.class : %.java
-	CLASSPATH=$(top_srcdir)/idlgen:$(top_srcdir)/impl:$(top_srcdir)/util:$(top_srcdir)/at-client:$(top_srcdir)/registry $(JAVAC) $<
+../gnome-java-bridge.jar : jar-stamp $(JAVA_FILES) $(DEP_CLASSES)
+	touch ../jar-stamp
+	$(JAR) uf ../gnome-java-bridge.jar org/GNOME/*/*.class
 
-clean-local:
-	$(RM) *.class
+$(DEP_CLASSES) : 
+	@(cd `dirname $ `; $(MAKE) )
 
+all-local: $(CLASSES) $(JARFILES)
diff -u -r ../cvs/java-access-bridge/registry/org/GNOME/Accessibility/DeviceEventControllerImpl.java java-access-bridge/registry/org/GNOME/Accessibility/DeviceEventControllerImpl.java
--- ../cvs/java-access-bridge/registry/org/GNOME/Accessibility/DeviceEventControllerImpl.java	2002-11-19 17:58:18.000000000 -0500
+++ java-access-bridge/registry/org/GNOME/Accessibility/DeviceEventControllerImpl.java	2005-03-15 23:23:37.000000000 -0500
@@ -57,7 +57,11 @@
 
 	public void generateKeyboardEvent (int keycode, String keystring, 
 				    KeySynthType type) {
-		; // TODO: can this be implemented cleanly?
+		if (keystring == null){
+			keystring="";
+		}
+		DeviceEventController dec=AccessUtil.getRegistryObject().getDeviceEventController();
+		dec.generateKeyboardEvent (keycode, keystring, type);
 	}
 
 	public void generateMouseEvent (int x, int y, String eventName) {


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