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

Method onInputEvent

Engine/source/gui/worldEditor/editTSCtrl.cpp:634–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632
633
634bool EditTSCtrl::onInputEvent(const InputEventInfo & event)
635{
636
637 if(mRightMousePassThru && event.deviceType == MouseDeviceType &&
638 event.objInst == KEY_BUTTON1 && event.action == SI_BREAK)
639 {
640 // if the right mouse pass thru is enabled,
641 // we want to reactivate mouse on a right mouse button up
642 GuiCanvas *pCanvas = getRoot();
643 if( !pCanvas )
644 return false;
645
646 PlatformWindow *pWindow = static_cast<GuiCanvas*>(getRoot())->getPlatformWindow();
647 if( !pWindow )
648 return false;
649
650 PlatformCursorController *pController = pWindow->getCursorController();
651 if( !pController )
652 return false;
653
654 pWindow->setMouseLocked(false);
655 pCanvas->setCursorON( true );
656
657 if(mDisplayType != DisplayTypePerspective)
658 {
659 mouseUnlock();
660 pCanvas->setForceMouseToGUI(false);
661 pCanvas->setClampTorqueCursor(mLastMouseClamping);
662 }
663 }
664
665 if(mMiddleMousePassThru && event.deviceType == MouseDeviceType &&
666 event.objInst == KEY_BUTTON2 && event.action == SI_BREAK)
667 {
668 // if the middle mouse pass thru is enabled,
669 // we want to reactivate mouse on a middle mouse button up
670 GuiCanvas *pCanvas = getRoot();
671 if( !pCanvas )
672 return false;
673
674 PlatformWindow *pWindow = static_cast<GuiCanvas*>(getRoot())->getPlatformWindow();
675 if( !pWindow )
676 return false;
677
678 PlatformCursorController *pController = pWindow->getCursorController();
679 if( !pController )
680 return false;
681
682 pWindow->setMouseLocked(false);
683 pCanvas->setCursorON( true );
684 }
685
686 // we return false so that the canvas can properly process the right mouse button up...
687 return false;
688}
689
690//------------------------------------------------------------------------------
691

Callers

nothing calls this directly

Calls 6

getPlatformWindowMethod · 0.80
getCursorControllerMethod · 0.80
setCursorONMethod · 0.80
setForceMouseToGUIMethod · 0.80
setClampTorqueCursorMethod · 0.80
setMouseLockedMethod · 0.45

Tested by

no test coverage detected