diff options
author | endolf <[email protected]> | 2006-10-31 20:46:46 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2006-10-31 20:46:46 +0000 |
commit | 299ffbb974f1ec88f3037e0b24beb940a21bb6f9 (patch) | |
tree | e28889170ba7fb156869c1bc4675ecbf24774368 | |
parent | bf644040687245cab1d558b41041ccad6a5655b7 (diff) |
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
-rw-r--r-- | plugins/wintab/src/native/net_java_games_input_WinTabContext.c | 11 |
1 files 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); |