protected void DestroyPusher(InputCodes key) { if (ActivePushers.FirstOrDefault(a => a.Code == key) != null) { ActivePushers.FirstOrDefault(a => a.Code == key).Instance.Dispose(); } }
public static UnityEngine.KeyCode GetInput(InputCodes code) { // switch(code) // { // //Input. // } return KeyCode.End; }
public static void InputCombination(InputCodes modifier, InputCodes code) { if (IsMouseInput(code)) { InputSimulator.Keyboard.KeyDown(InputToVirtualKeyCode(modifier)); Input(code); InputSimulator.Keyboard.KeyUp(InputToVirtualKeyCode(modifier)); } InputSimulator.Keyboard.ModifiedKeyStroke(InputToVirtualKeyCode(modifier).Yield(), InputToVirtualKeyCode(code).Yield()); }
public static void Input(InputCodes code) { //if (!NativeApiWrapper.GameWindow.IsActivated) // return; if (IsMouseInput(code)) { if (code == InputCodes.LButton) { Mouse.ClickLeft(); } if (code == InputCodes.RButton) { Mouse.ClickRight(); } if (code == InputCodes.MButton) { Mouse.ClickMiddle(); } } else { Keyboard.Press(InputToKey(code)); } }
static VirtualKeyCode InputToVirtualKeyCode(InputCodes code) { return((VirtualKeyCode)Enum.ToObject(typeof(VirtualKeyCode), (int)code)); }
static Keys InputToKey(InputCodes code) { return((Keys)Enum.ToObject(typeof(Keys), (int)code)); }
static bool IsMouseInput(InputCodes code) { return(code == InputCodes.LButton || code == InputCodes.RButton || code == InputCodes.MButton); }