Ajouter le parametre z

This commit is contained in:
yaw-man 2022-08-09 13:02:14 -03:00
parent 7246c3b853
commit ca10986e54
4 changed files with 15 additions and 1 deletions

View File

@ -35,6 +35,7 @@ enum Parameters {
kParameterTimeBeatsPerMinute, kParameterTimeBeatsPerMinute,
kParameterTabletX, kParameterTabletX,
kParameterTabletY, kParameterTabletY,
kParameterTabletZ,
kParameterTabletPressure, kParameterTabletPressure,
kParameterCount kParameterCount
}; };

View File

@ -165,6 +165,12 @@ protected:
parameter.ranges.min = 0; parameter.ranges.min = 0;
parameter.ranges.max = 1024; parameter.ranges.max = 1024;
break; break;
case kParameterTabletZ:
parameter.name = "TabletZ";
parameter.symbol = "tablet_z";
parameter.ranges.min = 0;
parameter.ranges.max = 1024;
break;
case kParameterTabletPressure: case kParameterTabletPressure:
parameter.name = "TabletPressure"; parameter.name = "TabletPressure";
parameter.symbol = "tablet_p"; parameter.symbol = "tablet_p";

View File

@ -3,7 +3,7 @@
#include "MSGPACK.H" #include "MSGPACK.H"
#include "wintab.h" #include "wintab.h"
#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE) #define PACKETDATA (PK_X | PK_Y | PK_Z | PK_BUTTONS | PK_NORMAL_PRESSURE)
#define PACKETMODE PK_BUTTONS #define PACKETMODE PK_BUTTONS
#include "pktdef.h" #include "pktdef.h"
#include "wtutil.h" #include "wtutil.h"
@ -46,6 +46,7 @@ private:
UINT wDevice = 0; UINT wDevice = 0;
AXIS TabletX = { 0 }; AXIS TabletX = { 0 };
AXIS TabletY = { 0 }; AXIS TabletY = { 0 };
AXIS TabletZ = { 0 };
AXIS TabletPressure = { 0 }; AXIS TabletPressure = { 0 };
LOGCONTEXT ctx = {}; LOGCONTEXT ctx = {};
@ -61,18 +62,23 @@ private:
//Tablet extents. //Tablet extents.
gpWTInfoA(WTI_DEVICES, DVC_X, &TabletX); gpWTInfoA(WTI_DEVICES, DVC_X, &TabletX);
gpWTInfoA(WTI_DEVICES, DVC_Y, &TabletY); gpWTInfoA(WTI_DEVICES, DVC_Y, &TabletY);
gpWTInfoA(WTI_DEVICES, DVC_Z, &TabletZ);
gpWTInfoA(WTI_DEVICES, DVC_NPRESSURE, &TabletPressure); gpWTInfoA(WTI_DEVICES, DVC_NPRESSURE, &TabletPressure);
ctx.lcInOrgX = 0; ctx.lcInOrgX = 0;
ctx.lcInOrgY = 0; ctx.lcInOrgY = 0;
ctx.lcInOrgZ = 0;
ctx.lcInExtX = TabletX.axMax; ctx.lcInExtX = TabletX.axMax;
ctx.lcInExtY = TabletY.axMax; ctx.lcInExtY = TabletY.axMax;
ctx.lcInExtZ = TabletZ.axMax;
maxPressure = TabletPressure.axMax; maxPressure = TabletPressure.axMax;
ctx.lcOutOrgX = GetSystemMetrics(SM_XVIRTUALSCREEN); ctx.lcOutOrgX = GetSystemMetrics(SM_XVIRTUALSCREEN);
ctx.lcOutOrgY = GetSystemMetrics(SM_YVIRTUALSCREEN); ctx.lcOutOrgY = GetSystemMetrics(SM_YVIRTUALSCREEN);
ctx.lcOutExtX = GetSystemMetrics(SM_CXVIRTUALSCREEN); ctx.lcOutExtX = GetSystemMetrics(SM_CXVIRTUALSCREEN);
ctx.lcOutExtY = -GetSystemMetrics(SM_CYVIRTUALSCREEN); ctx.lcOutExtY = -GetSystemMetrics(SM_CYVIRTUALSCREEN);
ctx.lcOutOrgZ = 0;
ctx.lcOutExtZ = ctx.lcInExtZ;
hctx = gpWTOpenA(hwnd, &ctx, FALSE); hctx = gpWTOpenA(hwnd, &ctx, FALSE);

View File

@ -50,6 +50,7 @@ protected:
tab.NewPacket(); tab.NewPacket();
fParameters[kParameterTabletX] = tab.pkt.pkX; fParameters[kParameterTabletX] = tab.pkt.pkX;
fParameters[kParameterTabletY] = tab.pkt.pkY; fParameters[kParameterTabletY] = tab.pkt.pkY;
fParameters[kParameterTabletZ] = tab.pkt.pkZ;
fParameters[kParameterTabletPressure] = tab.pkt.pkNormalPressure; fParameters[kParameterTabletPressure] = tab.pkt.pkNormalPressure;