ScriptReference/EventType.MouseDrag #611
Replies: 1 comment
-
|
just a heads up - mouse events captured inside an int controlId = GUIUtility.GetControlID( FocusType.Passive ); // used to track events even when outside the EditorWindow
bool holdingAlt = Event.current.modifiers.HasFlag( EventModifiers.Alt );
bool RMB = Event.current.isMouse && Event.current.button == 1;
switch( Event.current.GetTypeForControl( controlId ) ) {
case EventType.MouseDrag:
if( holdingAlt && RMB ) {
ZoomBy( Event.current.delta.y * -0.003f );
GUIUtility.hotControl = controlId; // lock control
Repaint();
}
break;
case EventType.MouseUp:
GUIUtility.hotControl = 0; // release control
break;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/EventType.MouseDrag
https://docs.unity3d.com/ScriptReference/EventType.MouseDrag.html
Beta Was this translation helpful? Give feedback.
All reactions