Skip to content

Commit

Permalink
First try MacOS send implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
calebwest-SS committed Mar 18, 2024
1 parent 382a103 commit c8a7425
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Source/Module/modules/controller/mouse/MouseMacFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ namespace mousemac {

}

void sendScrollWheelEvent() {
void sendScrollWheelEvent(int32 scrollX, int32 scrollY) {
#if JUCE_SUPPORT_CARBON

CGEventRef scrollEvent = CGEventCreateScrollWheelEvent(NULL, CGScrollEventUnit.line, 2, scrollY, scrollX)
#endif

}
Expand Down
8 changes: 5 additions & 3 deletions Source/Module/modules/controller/mouse/MouseModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ void MouseModule::setWheelData(float wheelDelta, int orientation)
Input.mi.dwFlags = wheelType;
Input.mi.mouseData = winWheelTravel;
::SendInput(1, &Input, sizeof(INPUT));
//#elif JUCE_MAC
// mousemac::sendScrollWheelEvent(buttonEvent, pos.x, pos.y);
#elif JUCE_MAC
int32 scrollX = (orientation == 1 ? 0 : wheelDelta * 5);
int32 scrollY = (orientation == 1 ? wheelDelta * 5 : 0);
mousemac::sendScrollWheelEvent(scrollX, scrollY);
#endif
}

Expand Down Expand Up @@ -188,7 +190,7 @@ void MouseModule::mouseWheelMove(const MouseEvent& e, const MouseWheelDetails& d
if (logIncomingData->boolValue()) NLOG(niceName, "Y Delta " << d.deltaY << " received. Reversed: " << revStr);
}
if (d.deltaX != 0) {
wheelXDelta->setValue(d.deltaX * reversed);
wheelXDelta->setValue(d.deltaX * reversed * -1);
wheelXData->trigger();
if (logIncomingData->boolValue()) NLOG(niceName, "X Delta " << d.deltaX << " received. Reversed: " << revStr);
}
Expand Down

0 comments on commit c8a7425

Please sign in to comment.