mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2026-03-27 07:34:59 +01:00
Make the default state connected to the cursor
This commit is contained in:
parent
2a7557fcfb
commit
f107ea2558
|
|
@ -17,14 +17,21 @@ JNIEXPORT jlong JNICALL Java_net_java_games_input_WinTabContext_nOpen(JNIEnv *en
|
||||||
HWND hWnd = (HWND)(INT_PTR)hWnd_long;
|
HWND hWnd = (HWND)(INT_PTR)hWnd_long;
|
||||||
HCTX hCtx = NULL;
|
HCTX hCtx = NULL;
|
||||||
|
|
||||||
/* get default region */
|
jclass booleanClass = (*env)->FindClass(env, "java/lang/Boolean");
|
||||||
WTInfo(WTI_DEFCONTEXT, 0, &context);
|
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");
|
wsprintf(context.lcName, "JInput Digitizing");
|
||||||
context.lcPktData = PACKETDATA;
|
context.lcPktData = PACKETDATA;
|
||||||
context.lcPktMode = PACKETMODE;
|
context.lcPktMode = PACKETMODE;
|
||||||
context.lcMoveMask = PACKETDATA;
|
context.lcMoveMask = PACKETDATA;
|
||||||
context.lcBtnUpMask = context.lcBtnDnMask;
|
context.lcBtnUpMask = context.lcBtnDnMask;
|
||||||
|
if(!detachCursor) {
|
||||||
|
context.lcOptions |= CXO_SYSTEM;
|
||||||
|
}
|
||||||
|
|
||||||
/* open the region */
|
/* open the region */
|
||||||
hCtx = WTOpen(hWnd, &context, TRUE);
|
hCtx = WTOpen(hWnd, &context, TRUE);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue