From 299ffbb974f1ec88f3037e0b24beb940a21bb6f9 Mon Sep 17 00:00:00 2001 From: endolf Date: Tue, 31 Oct 2006 20:46:46 +0000 Subject: Make the default state connected to the cursor git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@171 e343933a-64c8-49c5-92b1-88f2ce3e89e8 --- .../wintab/src/native/net_java_games_input_WinTabContext.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/wintab/src/native/net_java_games_input_WinTabContext.c b/plugins/wintab/src/native/net_java_games_input_WinTabContext.c index 10863f9..99d6fe5 100644 --- a/plugins/wintab/src/native/net_java_games_input_WinTabContext.c +++ b/plugins/wintab/src/native/net_java_games_input_WinTabContext.c @@ -17,14 +17,21 @@ JNIEXPORT jlong JNICALL Java_net_java_games_input_WinTabContext_nOpen(JNIEnv *en HWND hWnd = (HWND)(INT_PTR)hWnd_long; HCTX hCtx = NULL; - /* get default region */ - WTInfo(WTI_DEFCONTEXT, 0, &context); + jclass booleanClass = (*env)->FindClass(env, "java/lang/Boolean"); + jstring propertyName = (*env)->NewStringUTF(env, "jinput.wintab.detachcursor"); + jmethodID getBooleanMethod = (*env)->GetStaticMethodID(env, booleanClass, "getBoolean", "(Ljava/lang/String;)Z"); + jboolean detachCursor = (*env)->CallStaticBooleanMethod(env, booleanClass, getBooleanMethod, propertyName); + + WTInfo(WTI_DEFCONTEXT, 0, &context); wsprintf(context.lcName, "JInput Digitizing"); context.lcPktData = PACKETDATA; context.lcPktMode = PACKETMODE; context.lcMoveMask = PACKETDATA; context.lcBtnUpMask = context.lcBtnDnMask; + if(!detachCursor) { + context.lcOptions |= CXO_SYSTEM; + } /* open the region */ hCtx = WTOpen(hWnd, &context, TRUE); -- cgit v1.2.3