|
#include <windows.h>
#include "Mouse.h"
JNIEXPORT void JNICALL Java_Mouse_SetCursorPos(JNIEnv *env, jclass jc, jint x, jint y)
{
SetCursorPos(x, y);
}
JNIEXPORT void JNICALL Java_Mouse_ClickPoint(JNIEnv *env, jclass jc, jint x, jint y, jint button) {
switch(button) {
case Mouse_BUTTON_1:
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
break;
case Mouse_BUTTON_2:
mouse_event(MOUSEEVENTF_MIDDLEDOWN, x, y, 0, 0);
mouse_event(MOUSEEVENTF_MIDDLEUP, x, y, 0, 0);
break;
case Mouse_BUTTON_3:
mouse_event(MOUSEEVENTF_RIGHTDOWN, x, y, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, x, y, 0, 0);
break;
}
}
|
|