< prev index next >
jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
Print this page
@@ -47,10 +47,13 @@
#include <Region.h>
#include "utility/rect.h"
#include <X11/XKBlib.h>
+// From XWindow.c
+extern KeySym keycodeToKeysym(Display *display, KeyCode keycode, int index);
+
#if defined(DEBUG)
static jmethodID lockIsHeldMID = NULL;
static void
CheckHaveAWTLock(JNIEnv *env)
@@ -1284,11 +1287,11 @@
if( !kc7 ) {
// keycode is not defined. Why, it's a reduced keyboard perhaps:
// report arbitrarily false.
return JNI_FALSE;
} else {
- long ks2 = XKeycodeToKeysym((Display*)jlong_to_ptr(display), kc7, 2);
+ long ks2 = keycodeToKeysym((Display*)jlong_to_ptr(display), kc7, 2);
if( ks2 == XK_KP_7 ) {
//XXX If some Xorg server would put XK_KP_7 in keysymarray[2] as well,
//XXX for yet unknown to me reason, the sniffer would lie.
return JNI_TRUE;
}else{
@@ -1913,16 +1916,17 @@
AWT_CHECK_HAVE_LOCK();
XQueryKeymap( (Display *) jlong_to_ptr(display), (char *) jlong_to_ptr(vector));
}
+// XKeycodeToKeysym is deprecated but for compatibility we keep the API.
JNIEXPORT jlong JNICALL
Java_sun_awt_X11_XlibWrapper_XKeycodeToKeysym(JNIEnv *env, jclass clazz,
jlong display, jint keycode,
jint index) {
AWT_CHECK_HAVE_LOCK_RETURN(0);
- return XKeycodeToKeysym((Display*) jlong_to_ptr(display), (unsigned int)keycode, (int)index);
+ return keycodeToKeysym((Display*)jlong_to_ptr(display), (unsigned int)keycode, (int)index);
}
JNIEXPORT jint JNICALL
Java_sun_awt_X11_XlibWrapper_XkbGetEffectiveGroup(JNIEnv *env, jclass clazz,
jlong display) {
< prev index next >