Ajouter le parametre z
This commit is contained in:
parent
7246c3b853
commit
ca10986e54
|
@ -35,6 +35,7 @@ enum Parameters {
|
|||
kParameterTimeBeatsPerMinute,
|
||||
kParameterTabletX,
|
||||
kParameterTabletY,
|
||||
kParameterTabletZ,
|
||||
kParameterTabletPressure,
|
||||
kParameterCount
|
||||
};
|
||||
|
|
|
@ -165,6 +165,12 @@ protected:
|
|||
parameter.ranges.min = 0;
|
||||
parameter.ranges.max = 1024;
|
||||
break;
|
||||
case kParameterTabletZ:
|
||||
parameter.name = "TabletZ";
|
||||
parameter.symbol = "tablet_z";
|
||||
parameter.ranges.min = 0;
|
||||
parameter.ranges.max = 1024;
|
||||
break;
|
||||
case kParameterTabletPressure:
|
||||
parameter.name = "TabletPressure";
|
||||
parameter.symbol = "tablet_p";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "MSGPACK.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
|
||||
#include "pktdef.h"
|
||||
#include "wtutil.h"
|
||||
|
@ -46,6 +46,7 @@ private:
|
|||
UINT wDevice = 0;
|
||||
AXIS TabletX = { 0 };
|
||||
AXIS TabletY = { 0 };
|
||||
AXIS TabletZ = { 0 };
|
||||
AXIS TabletPressure = { 0 };
|
||||
LOGCONTEXT ctx = {};
|
||||
|
||||
|
@ -61,18 +62,23 @@ private:
|
|||
//Tablet extents.
|
||||
gpWTInfoA(WTI_DEVICES, DVC_X, &TabletX);
|
||||
gpWTInfoA(WTI_DEVICES, DVC_Y, &TabletY);
|
||||
gpWTInfoA(WTI_DEVICES, DVC_Z, &TabletZ);
|
||||
gpWTInfoA(WTI_DEVICES, DVC_NPRESSURE, &TabletPressure);
|
||||
|
||||
ctx.lcInOrgX = 0;
|
||||
ctx.lcInOrgY = 0;
|
||||
ctx.lcInOrgZ = 0;
|
||||
ctx.lcInExtX = TabletX.axMax;
|
||||
ctx.lcInExtY = TabletY.axMax;
|
||||
ctx.lcInExtZ = TabletZ.axMax;
|
||||
maxPressure = TabletPressure.axMax;
|
||||
|
||||
ctx.lcOutOrgX = GetSystemMetrics(SM_XVIRTUALSCREEN);
|
||||
ctx.lcOutOrgY = GetSystemMetrics(SM_YVIRTUALSCREEN);
|
||||
ctx.lcOutExtX = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||
ctx.lcOutExtY = -GetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||
ctx.lcOutOrgZ = 0;
|
||||
ctx.lcOutExtZ = ctx.lcInExtZ;
|
||||
|
||||
hctx = gpWTOpenA(hwnd, &ctx, FALSE);
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ protected:
|
|||
tab.NewPacket();
|
||||
fParameters[kParameterTabletX] = tab.pkt.pkX;
|
||||
fParameters[kParameterTabletY] = tab.pkt.pkY;
|
||||
fParameters[kParameterTabletZ] = tab.pkt.pkZ;
|
||||
fParameters[kParameterTabletPressure] = tab.pkt.pkNormalPressure;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue