Patch: KeyEvent generation
Thomas Fitzsimmons
fitzsim@redhat.com
Sat Aug 2 09:15:00 GMT 2003
Hello,
This patch improves gtk peer KeyEvent generation, and KeyEvent's
paramString method. With this patch, libgcj generates key event output
that matches the output generated by Sun's JVM. It was tested on a US
keyboard.
Please review and comment.
Thanks,
Tom
2003-08-01 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (postKeyEvent):
Add keyLocation parameter.
* java/awt/event/KeyEvent.java (getKeyText): Fix "NumPad-"
string.
(paramString): Generate keyChar string according to keyChar, not
keyCode.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
(state_to_awt_mods): Handle ALT key.
(keyevent_state_to_awt_mods): New function.
(get_first_keyval_from_keymap): New function.
(keysym_to_awt_keycode): Get virtual key code from keymap.
Handle missing VK_ values.
(keysym_to_awt_keylocation): New function.
(keyevent_to_awt_keychar): New function.
(generates_key_typed_event): Handle non-text-component case.
Handle GDK_KP_Delete and GDK_KP_Enter.
(awt_event_handler): Call new functions to get postKeyEvent
parameters.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c (gtkInit):
Update postKeyEvent method signature.
* jni/gtk-peer/gtkpeer.h: Add KEY_LOCATION defines. Add missing
VK_ defines.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keyevent.diff
Type: text/x-patch
Size: 37315 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20030802/fc9578d7/attachment.bin>
More information about the Java-patches
mailing list