47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Windows.Input;
|
|
|
|
namespace Qrakhen.Qamp.Editor.InputService;
|
|
|
|
public interface IInputHandler
|
|
{
|
|
|
|
}
|
|
|
|
public enum ActionId
|
|
{
|
|
None,
|
|
Undo,
|
|
Redo,
|
|
Copy,
|
|
Paste,
|
|
Delete,
|
|
MoveUp,
|
|
MoveDown,
|
|
MoveRight,
|
|
MoveLeft,
|
|
Submit,
|
|
Close
|
|
}
|
|
|
|
public delegate void KeyEventListener();
|
|
|
|
public class InputService : IInputHandler
|
|
{
|
|
public static bool LeftCtrlHeld => Keyboard.IsKeyDown(Key.LeftCtrl);
|
|
public static bool LeftShiftHeld => Keyboard.IsKeyDown(Key.LeftShift);
|
|
public static bool LeftAltHeld => Keyboard.IsKeyDown(Key.LeftAlt);
|
|
public static bool RightCtrlHeld => Keyboard.IsKeyDown(Key.RightCtrl);
|
|
public static bool RightShiftHeld => Keyboard.IsKeyDown(Key.LeftCtrl);
|
|
public static bool RightAltHeld => Keyboard.IsKeyDown(Key.RightAlt);
|
|
public static bool CtrlHeld => LeftCtrlHeld || RightCtrlHeld;
|
|
public static bool ShiftHeld => LeftShiftHeld || RightShiftHeld;
|
|
public static bool AltHeld => LeftAltHeld || RightAltHeld;
|
|
|
|
public static void AddKeyListener(Key key, params Key[] modifiers)
|
|
{
|
|
|
|
}
|
|
} |