|
@@ -6969,7 +6969,7 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|
short wheelmark = 0;
|
|
short wheelmark = 0;
|
|
int WheelDir = 0;
|
|
int WheelDir = 0;
|
|
UINT32 pointerId; POINTER_INPUT_TYPE pointerType;
|
|
UINT32 pointerId; POINTER_INPUT_TYPE pointerType;
|
|
- POINTER_PEN_INFO penInfo; POINTER_TOUCH_INFO touchInfo;
|
|
|
|
|
|
+ POINTER_PEN_INFO penInfo[128]; POINTER_TOUCH_INFO touchInfo; int peninfonum = 128;
|
|
POINT point;
|
|
POINT point;
|
|
PACKET pkt;
|
|
PACKET pkt;
|
|
static POINT ptOld, ptNew;
|
|
static POINT ptOld, ptNew;
|
|
@@ -6999,17 +6999,17 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|
break;
|
|
break;
|
|
case WT_PACKET:
|
|
case WT_PACKET:
|
|
if (!MAIN.InkOrWinTab) { break; /* Use Windows Ink. */ }
|
|
if (!MAIN.InkOrWinTab) { break; /* Use Windows Ink. */ }
|
|
- if (gpWTPacket((HCTX)lparam, wparam, &pkt)){
|
|
|
|
- MAIN.StylusPressure = (real)pkt.pkNormalPressure/MAIN.WinTabMaxPenPressure;
|
|
|
|
- real angle = (real)pkt.pkOrientation.orAzimuth / 3600*TNS_PI*2+TNS_PI/2;
|
|
|
|
- MAIN.StylusOrientation = angle; MAIN.StylusDeviation=rad((90.0f-(real)pkt.pkOrientation.orAltitude/10.0f));
|
|
|
|
- real tw=(real)pkt.pkOrientation.orTwist; tw=rad(tw/10);
|
|
|
|
|
|
+ if (gpWTPacket((HCTX)lparam, wparam, &pkt)) {
|
|
|
|
+ MAIN.StylusPressure = (real)pkt.pkNormalPressure / MAIN.WinTabMaxPenPressure;
|
|
|
|
+ real angle = (real)pkt.pkOrientation.orAzimuth / 3600 * TNS_PI * 2 + TNS_PI / 2;
|
|
|
|
+ MAIN.StylusOrientation = angle; MAIN.StylusDeviation = rad((90.0f - (real)pkt.pkOrientation.orAltitude / 10.0f));
|
|
|
|
+ real tw = (real)pkt.pkOrientation.orTwist; tw = rad(tw / 10);
|
|
MAIN.StylusTwist = tw;
|
|
MAIN.StylusTwist = tw;
|
|
- MAIN.EraserDeviation=MAIN.StylusDeviation;MAIN.EraserOrientation=MAIN.StylusOrientation;
|
|
|
|
- MAIN.EraserPressure=MAIN.StylusPressure;
|
|
|
|
- MAIN.IsPen = 1; MAIN.PointerIsEraser=((pkt.pkStatus & TPS_INVERT)==TPS_INVERT);
|
|
|
|
|
|
+ MAIN.EraserDeviation = MAIN.StylusDeviation; MAIN.EraserOrientation = MAIN.StylusOrientation;
|
|
|
|
+ MAIN.EraserPressure = MAIN.StylusPressure;
|
|
|
|
+ MAIN.IsPen = 1; MAIN.PointerIsEraser = ((pkt.pkStatus & TPS_INVERT) == TPS_INVERT);
|
|
}
|
|
}
|
|
- break;
|
|
|
|
|
|
+ return 0; break;
|
|
|
|
|
|
case WM_SYSCOMMAND:
|
|
case WM_SYSCOMMAND:
|
|
switch (wparam) {
|
|
switch (wparam) {
|
|
@@ -7029,6 +7029,8 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|
case WM_SETCURSOR:
|
|
case WM_SETCURSOR:
|
|
if(MAIN.CurrentCursor) return 1;
|
|
if(MAIN.CurrentCursor) return 1;
|
|
break;
|
|
break;
|
|
|
|
+ case WM_POINTERDOWN:
|
|
|
|
+ case WM_POINTERUP:
|
|
case WM_POINTERUPDATE:
|
|
case WM_POINTERUPDATE:
|
|
if (MAIN.InkOrWinTab) { break;/* Use WinTab. */ }
|
|
if (MAIN.InkOrWinTab) { break;/* Use WinTab. */ }
|
|
pointerId = GET_POINTERID_WPARAM(wparam);
|
|
pointerId = GET_POINTERID_WPARAM(wparam);
|
|
@@ -7036,14 +7038,26 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|
|
|
|
|
if(!GetPointerType(pointerId, &pointerType)){
|
|
if(!GetPointerType(pointerId, &pointerType)){
|
|
pointerType = PT_POINTER;
|
|
pointerType = PT_POINTER;
|
|
- printf("is pointer\n");
|
|
|
|
}
|
|
}
|
|
if(pointerType == PT_PEN){
|
|
if(pointerType == PT_PEN){
|
|
- if(GetPointerPenInfo(pointerId, &penInfo)){
|
|
|
|
- point.x = penInfo.pointerInfo.ptPixelLocation.x; point.y = penInfo.pointerInfo.ptPixelLocation.y;
|
|
|
|
- ScreenToClient(hwnd, &point);
|
|
|
|
- MAIN.IsPen = 1; MAIN.StylusPressure = (real)penInfo.pressure / 1024; MAIN.PointerIsEraser = 0;
|
|
|
|
|
|
+ if(GetPointerPenInfoHistory(pointerId, &peninfonum, penInfo)){
|
|
|
|
+ for (int i = peninfonum-1; i>=0; i--) {
|
|
|
|
+ point.x = penInfo[i].pointerInfo.ptPixelLocation.x; point.y = penInfo[i].pointerInfo.ptPixelLocation.y;
|
|
|
|
+ ScreenToClient(hwnd, &point);
|
|
|
|
+ MAIN.IsPen = 1; MAIN.StylusPressure = (real)penInfo[i].pressure / 1024; MAIN.PointerIsEraser = 0;
|
|
|
|
+ switch (penInfo[i].pointerInfo.ButtonChangeType) {
|
|
|
|
+ case POINTER_CHANGE_FIRSTBUTTON_DOWN: la_SendMouseEvent(hwnd, LA_L_MOUSE_DOWN, point.x, point.y); break;
|
|
|
|
+ case POINTER_CHANGE_FIRSTBUTTON_UP: la_SendMouseEvent(hwnd, LA_L_MOUSE_UP, point.x, point.y); break;
|
|
|
|
+ case POINTER_CHANGE_SECONDBUTTON_DOWN: la_SendMouseEvent(hwnd, LA_M_MOUSE_DOWN, point.x, point.y); break;
|
|
|
|
+ case POINTER_CHANGE_SECONDBUTTON_UP: la_SendMouseEvent(hwnd, LA_M_MOUSE_UP, point.x, point.y); break;
|
|
|
|
+ case POINTER_CHANGE_THIRDBUTTON_DOWN: la_SendMouseEvent(hwnd, LA_R_MOUSE_DOWN, point.x, point.y); break;
|
|
|
|
+ case POINTER_CHANGE_THIRDBUTTON_UP: la_SendMouseEvent(hwnd, LA_R_MOUSE_UP, point.x, point.y); break;
|
|
|
|
+ }
|
|
|
|
+ la_SendMouseEvent(hwnd, LA_MOUSEMOVE, point.x, point.y);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ SkipPointerFrameMessages(pointerId);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
else if (pointerType == PT_TOUCH){
|
|
else if (pointerType == PT_TOUCH){
|
|
if (GetPointerTouchInfo(pointerId, &touchInfo)) {
|
|
if (GetPointerTouchInfo(pointerId, &touchInfo)) {
|