FairyGUI.Stage.HandleGUIEvents C# (CSharp) Method

HandleGUIEvents() private method

private HandleGUIEvents ( Event evt ) : void
evt Event
return void
		internal void HandleGUIEvents(Event evt)
		{
			if (evt.rawType == EventType.KeyDown && evt.keyCode != KeyCode.None)
			{
				TouchInfo touch = _touches[0];
				touch.keyCode = evt.keyCode;
				touch.modifiers = evt.modifiers;
				InputEvent.shiftDown = (evt.modifiers & EventModifiers.Shift) != 0;

				touch.UpdateEvent();
				DisplayObject f = this.focus;
				if (f != null)
					f.onKeyDown.BubbleCall(touch.evt);
				else
					this.onKeyDown.Call(touch.evt);
			}
			else if (evt.rawType == EventType.KeyUp)
			{
				TouchInfo touch = _touches[0];
				touch.modifiers = evt.modifiers;
			}
			else if (evt.type == EventType.scrollWheel)
			{
				if (_touchTarget != null)
				{
					TouchInfo touch = _touches[0];
					touch.mouseWheelDelta = (int)evt.delta.y;
					touch.UpdateEvent();
					_touchTarget.onMouseWheel.BubbleCall(touch.evt);
				}
			}
		}

Usage Example

Example #1
0
 void OnGUI()
 {
     _stage.HandleGUIEvents(Event.current);
 }