|
@@ -268,7 +268,7 @@ void la_DestroySystemWindowX11(laWindow* w) {
|
|
|
#include <msgdef.h>
|
|
|
#include <wintab.h>
|
|
|
#include <wintab_utils.h>
|
|
|
-#define PACKETDATA (PK_X | PK_Y | PK_STATUS | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION | PK_TIME | PK_CURSOR)
|
|
|
+#define PACKETDATA (PK_X | PK_Y | PK_Z | PK_STATUS | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION | PK_TIME | PK_CURSOR)
|
|
|
#define PACKETMODE PK_BUTTONS
|
|
|
#include <pktdef.h>
|
|
|
|
|
@@ -279,7 +279,7 @@ void la_OpenWacomWinTab(HWND hwnd){
|
|
|
|
|
|
HCTX hctx = NULL;
|
|
|
UINT wDevice = 0; UINT wExtX = 0; UINT wExtY = 0;
|
|
|
- UINT wWTInfoRetVal = 0; AXIS TabletX = { 0 }; AXIS TabletY = { 0 };
|
|
|
+ UINT wWTInfoRetVal = 0; AXIS TabletX = { 0 }; AXIS TabletY = { 0 }; AXIS TabletZ = { 0 };
|
|
|
|
|
|
glogContext.lcOptions |= CXO_SYSTEM;
|
|
|
wWTInfoRetVal = gpWTInfoA(WTI_DEFSYSCTX, 0, &glogContext);
|
|
@@ -299,6 +299,10 @@ void la_OpenWacomWinTab(HWND hwnd){
|
|
|
wWTInfoRetVal = gpWTInfoA(WTI_DEVICES, DVC_Y, &TabletY);
|
|
|
assert(wWTInfoRetVal == sizeof(AXIS));
|
|
|
|
|
|
+ wWTInfoRetVal = gpWTInfoA(WTI_DEVICES, DVC_Z, &TabletZ);
|
|
|
+ assert(wWTInfoRetVal == sizeof(AXIS));
|
|
|
+ MAIN.WinTabMaxHover = TabletZ.axMax;
|
|
|
+
|
|
|
AXIS tabletPressure = { 0 };
|
|
|
gpWTInfoA(WTI_DEVICES, DVC_NPRESSURE, &tabletPressure); MAIN.WinTabMaxPenPressure = tabletPressure.axMax + 1;
|
|
|
|
|
@@ -1787,7 +1791,7 @@ void la_SaveEvent(SYSWINDOW hwnd, laEvent *e, int use_last_pos){
|
|
|
e->Pressure=MAIN.IsPen?(MAIN.PointerIsEraser?MAIN.EraserPressure:MAIN.StylusPressure):0.5f;
|
|
|
e->Orientation=MAIN.PointerIsEraser?MAIN.EraserOrientation:MAIN.StylusOrientation;
|
|
|
e->Deviation=MAIN.PointerIsEraser?MAIN.EraserDeviation:MAIN.StylusDeviation;
|
|
|
- e->IsEraser=MAIN.PointerIsEraser;
|
|
|
+ e->IsEraser=MAIN.PointerIsEraser; e->Hover=MAIN.StylusHover;
|
|
|
e->GoodPressure=MAIN.IsPen;
|
|
|
|
|
|
lstAppendItem(el, (laListItem *)e);
|
|
@@ -7491,6 +7495,7 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|
|
if (!MAIN.InkOrWinTab) { break; /* Use Windows Ink. */ }
|
|
|
if (gpWTPacket((HCTX)lparam, wparam, &pkt)) {
|
|
|
MAIN.StylusPressure = (real)pkt.pkNormalPressure / MAIN.WinTabMaxPenPressure;
|
|
|
+ MAIN.StylusHover = (real)pkt.pkZ / MAIN.WinTabMaxHover;
|
|
|
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);
|