MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / cursorNudge

Method cursorNudge

Engine/source/gui/core/guiCanvas.cpp:588–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586}
587
588void GuiCanvas::cursorNudge(F32 x, F32 y)
589{
590 // Generate a base Movement along and Axis event
591 InputEventInfo inputEvent;
592 inputEvent.deviceType = MouseDeviceType;
593 inputEvent.deviceInst = 0;
594 inputEvent.objType = SI_AXIS;
595 inputEvent.modifier = (InputModifiers)0;
596 inputEvent.ascii = 0;
597
598 // Generate delta movement along each axis
599 Point2F cursDelta(x, y);
600
601 // If X axis changed, generate a relative event
602 if(mFabs(cursDelta.x) > 0.1)
603 {
604 inputEvent.objInst = SI_XAXIS;
605 inputEvent.action = SI_MOVE;
606 inputEvent.fValue = cursDelta.x;
607 processMouseEvent(inputEvent);
608 }
609
610 // If Y axis changed, generate a relative event
611 if(mFabs(cursDelta.y) > 0.1)
612 {
613 inputEvent.objInst = SI_YAXIS;
614 inputEvent.action = SI_MOVE;
615 inputEvent.fValue = cursDelta.y;
616 processMouseEvent(inputEvent);
617 }
618
619 processMouseEvent(inputEvent);
620}
621
622void GuiCanvas::addAcceleratorKey(GuiControl *ctrl, U32 index, U32 keyCode, U32 modifier)
623{

Callers 1

DefineEngineMethodFunction · 0.80

Calls 1

mFabsFunction · 0.85

Tested by

no test coverage detected