Exemplo n.º 1
0
 private void OnKeyUp(object sender, KeyUpEventArgs e)
 {
     if (!Enabled)
     {
         return;
     }
     if (IsPressed(e) && HotkeyPressedEventHandler != null)
     {
         Logger.LogDebug("Pressed: " + ToString());
         e.Handled |= SuppressHotkey;
         Task.Run(() => HotkeyPressedEventHandler(sender, e));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Stops the camera rotation down.
        /// </summary>
        /// <param name="args">The key up event data.</param>
        void StopCameraRotationDown(KeyUpEventArgs args)
        {
            if (!activeCameraMovement.RotateDown)
            {
                return;
            }
            activeCameraMovement.RotateDown = false;

            var pitch = camera.StaticPitch + CameraRotationSensitivity;

            if (FloatHelpers.FloatsEqual(pitch, 0))
            {
                pitch = 0;
            }
            camera.SetStaticPitchChange(pitch);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Stops the camera rotation to the left,
        /// </summary>
        /// <param name="args">The key up event data.</param>
        void StopCameraRotationLeft(KeyUpEventArgs args)
        {
            if (!activeCameraMovement.RotateLeft)
            {
                return;
            }
            activeCameraMovement.RotateLeft = false;

            var yaw = camera.StaticYaw + CameraRotationSensitivity;

            if (FloatHelpers.FloatsEqual(yaw, 0))
            {
                yaw = 0;
            }
            camera.SetStaticYawChange(yaw);
        }
Exemplo n.º 4
0
        void Input_KeyUp(KeyUpEventArgs e)
        {
            switch (e.Key)
            {
            case Key.X:
                RotateAxis(e.Qualifiers > 0 ? -90 : 90, 0, 0);
                break;

            case Key.Y:
                RotateAxis(0, e.Qualifiers > 0 ? -90 : 90, 0);
                break;

            case Key.Z:
                RotateAxis(0, 0, e.Qualifiers > 0 ? -90 : 90);
                break;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Stops the camera movement backwards.
        /// </summary>
        /// <param name="args">The key up event data.</param>
        void StopCameraMoveBackward(KeyUpEventArgs args)
        {
            //If the camera movement was stoped by other means, dont stop it again
            if (!activeCameraMovement.MoveBackward)
            {
                return;
            }
            activeCameraMovement.MoveBackward = false;

            var movement = camera.StaticMovement;

            movement.Z += CameraScrollSensitivity;
            if (FloatHelpers.FloatsEqual(movement.Z, 0))
            {
                movement.Z = 0;
            }
            camera.SetStaticMovement(movement);
        }
Exemplo n.º 6
0
 // Token: 0x06015605 RID: 87557 RVA: 0x0056C36C File Offset: 0x0056A56C
 private void _ProcessKeyboard()
 {
     if (Event.current != null && Event.current.isKey)
     {
         if (Event.current.rawType == EventType.KeyDown)
         {
             KeyDownEventArgs e = new KeyDownEventArgs(Event.current.keyCode);
             if (this.OnKeyDown != null)
             {
                 this.OnKeyDown(this, e);
             }
         }
         else if (Event.current.rawType == EventType.KeyUp)
         {
             KeyUpEventArgs e2 = new KeyUpEventArgs(Event.current.keyCode);
             if (this.OnKeyUp != null)
             {
                 this.OnKeyUp(this, e2);
             }
         }
     }
 }
Exemplo n.º 7
0
            protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
            {
                // Make sure that the user started holding the key during the hold note
                if (!holdNote.holdStartTime.HasValue)
                {
                    return(false);
                }

                if (Judgement.Result != HitResult.None)
                {
                    return(false);
                }

                if (args.Key != Key)
                {
                    return(false);
                }

                UpdateJudgement(true);

                // Handled by the hold note, which will set holding = false
                return(false);
            }
Exemplo n.º 8
0
        protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
        {
            // Make sure that the user started holding the key during the hold note
            if (!holdStartTime.HasValue)
            {
                return(false);
            }

            if (args.Key != Key)
            {
                return(false);
            }

            holdStartTime = null;

            // If the key has been released too early, the user should not receive full score for the release
            if (!tail.Judged)
            {
                hasBroken = true;
            }

            return(true);
        }
Exemplo n.º 9
0
        internal bool IsPressed(KeyUpEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(e), "KeyUpEventArgs can not be empty!");
            }

            var keyDownInHotkey = false;

            if (RequiresKeyboard)
            {
                foreach (var keyboardKey in KeyboardKeys)
                {
                    var vKey = KeyInterop.VirtualKeyFromKey(keyboardKey);
                    if (!IsKeyDown(vKey))
                    {
                        return(false);
                    }
                    keyDownInHotkey |= e.Key == KeyInterop.VirtualKeyFromKey(keyboardKey);
                }
            }

            if (RequiresMouse)
            {
                foreach (var mouseButton in MouseButtons)
                {
                    var vKey = MouseButtonToVKey(mouseButton);
                    if (!IsKeyDown(vKey))
                    {
                        return(false);
                    }
                    keyDownInHotkey |= vKey == e.Key;
                }
            }

            return(keyDownInHotkey);
        }
Exemplo n.º 10
0
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) => handleNewReleased(state, KeyCombination.FromKey(args.Key));
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
 {
     OnKeyDown(state, null);
     return(false);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Invoked when a key is released.
 /// </summary>
 /// <param name="e">Additional data of the key release event.</param>
 protected abstract void KeyUp(KeyUpEventArgs e);
Exemplo n.º 13
0
 protected override bool PropagateKeyUp(IEnumerable <Drawable> drawables, InputState state, KeyUpEventArgs args) =>
 base.PropagateKeyUp(drawables, state, args) || handleNewReleased(state, KeyCombination.FromKey(args.Key));
Exemplo n.º 14
0
 ///<inheritdoc />
 protected override void KeyUp(KeyUpEventArgs e)
 {
 }
Exemplo n.º 15
0
 private void OnKeyUp(KeyUpEventArgs args)
 {
     _keyUp?.Invoke(this, new KeyUpEventArguments(args));
 }
Exemplo n.º 16
0
Arquivo: Column.cs Projeto: tgi74/osu
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) => KeyUp?.Invoke(state, args) ?? false;
Exemplo n.º 17
0
 private void Hook_KeyUp(object sender, KeyUpEventArgs e)
 {
     KD.KeyUp(e.Key);
 }
Exemplo n.º 18
0
 private void OnIconScanHotkey(object sender, KeyUpEventArgs e)
 {
     Wrap(() => RatScannerMain.Instance.IconScan(UserActivityHelper.GetMousePosition()));
 }
Exemplo n.º 19
0
 private void EntityManager_KeyUp(object sender, KeyUpEventArgs e)
 {
     upKeys.Add(e.Key);
 }
Exemplo n.º 20
0
 public KeyUpEventArguments(KeyUpEventArgs args) : base(args)
 {
 }
Exemplo n.º 21
0
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) => target.Children.Any(c => c.TriggerKeyUp(state, args));
Exemplo n.º 22
0
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
 {
     HandlePendingText(state);
     return(base.OnKeyUp(state, args));
 }
Exemplo n.º 23
0
 private void HandleKeyUp(KeyUpEventArgs args)
 {
 }
Exemplo n.º 24
0
 // Token: 0x060155D7 RID: 87511 RVA: 0x0056B760 File Offset: 0x00569960
 private void _ConsoleView_OnKeyUp(object sender, KeyUpEventArgs e)
 {
 }
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) => AllowUserPresses && base.OnKeyUp(state, args);
Exemplo n.º 26
0
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) => BlockPassThroughKeyboard;
Exemplo n.º 27
0
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
 {
     base.OnKeyUp(state, args);
     return(false);
 }
Exemplo n.º 28
0
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
 {
     ++KeyUpCount;
     return(base.OnKeyUp(state, args));
 }
Exemplo n.º 29
0
 protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
 {
     if (args.Key == this.Key) IsLit = false;
     return base.OnKeyUp(state, args);
 }