< prev index next >
jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
Print this page
*** 47,56 ****
--- 47,59 ----
#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,1294 ****
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);
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{
--- 1287,1297 ----
if( !kc7 ) {
// keycode is not defined. Why, it's a reduced keyboard perhaps:
// report arbitrarily false.
return JNI_FALSE;
} else {
! 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,1928 ****
AWT_CHECK_HAVE_LOCK();
XQueryKeymap( (Display *) jlong_to_ptr(display), (char *) jlong_to_ptr(vector));
}
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);
}
JNIEXPORT jint JNICALL
Java_sun_awt_X11_XlibWrapper_XkbGetEffectiveGroup(JNIEnv *env, jclass clazz,
jlong display) {
--- 1916,1932 ----
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 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 >