コード例 #1
0
        internal void Window_MouseWheelScrolled(object sender, MouseWheelScrollEventArgs e)
        {
            Key WheelEvent = e.Delta >= 0 ? Key.MouseWheelUp : Key.MouseWheelDown;

            if (e.Delta != 0)
            {
                OnPressedEvent?.Invoke(WheelEvent, PlayerFlags.ANY_PLAYER);
                OnReleasedEvent?.Invoke(WheelEvent, PlayerFlags.ANY_PLAYER);
            }
        }
コード例 #2
0
 internal void OnWindowMouseEvent(Veldrid.MouseEvent obj)
 {
     if (obj.Down)
     {
         OnPressedEvent?.Invoke(obj.MouseButton.Convert(), PlayerFlags.ANY_PLAYER);
     }
     else
     {
         OnReleasedEvent?.Invoke(obj.MouseButton.Convert(), PlayerFlags.ANY_PLAYER);
     }
 }
コード例 #3
0
        internal void OnWindowKeyEvent(Veldrid.KeyEvent obj)
        {
            if (obj.Repeat)
            {
                return;
            }

            if (obj.Down)
            {
                OnPressedEvent?.Invoke(obj.Key.Convert(), PlayerFlags.ANY_PLAYER);
            }
            else
            {
                OnReleasedEvent?.Invoke(obj.Key.Convert(), PlayerFlags.ANY_PLAYER);
            }
        }
コード例 #4
0
 internal void OnPressedInternal()
 {
     OnPressedEvent?.Invoke();
     OnPressed();
 }
コード例 #5
0
 internal void Window_KeyPressed(object sender, MouseButtonEventArgs e)
 {
     OnPressedEvent?.Invoke(SFMLKeyConverter.Convert(e.Button), PlayerFlags.ANY_PLAYER);
 }