WIP: Wacom twist support for GHOST #107729
|
@ -975,6 +975,8 @@ GHOST_TSuccess GHOST_WindowWin32::getPointerInfo(
|
||||||
if (pointerPenInfo[i].penMask & PEN_MASK_ROTATION) {
|
if (pointerPenInfo[i].penMask & PEN_MASK_ROTATION) {
|
||||||
/* POINTER_PEN_INFO specifies rotation range to be [0,359], convert to radiant here. */
|
/* POINTER_PEN_INFO specifies rotation range to be [0,359], convert to radiant here. */
|
||||||
outPointerInfo[i].tabletData.Twist = ((float)pointerPenInfo[i].rotation / 360.0f) * M_PI_2;
|
outPointerInfo[i].tabletData.Twist = ((float)pointerPenInfo[i].rotation / 360.0f) * M_PI_2;
|
||||||
|
/* Debug only. */
|
||||||
|
printf("Twist (ink): %f\n", outPointerInfo[i].tabletData.Twist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -375,6 +375,7 @@ void GHOST_Wintab::getInput(std::vector<GHOST_WintabInfoWin32> &outWintabInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_maxTwist > 0) {
|
if (m_maxTwist > 0) {
|
||||||
|
ORIENTATION ort = pkt.pkOrientation;
|
||||||
out.tabletData.Twist = float(float(ort.orTwist) / float(m_maxTwist) * M_PI);
|
out.tabletData.Twist = float(float(ort.orTwist) / float(m_maxTwist) * M_PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue