public override Action Start() { IntPtr handle = Process.GetCurrentProcess().MainWindowHandle; KeyboardDevice = new SharpDX.DirectInput.Keyboard(DirectInputInstance); if (KeyboardDevice == null) { throw new Exception("Failed to create keyboard device"); } KeyboardDevice.SetCooperativeLevel(handle, CooperativeLevel.Background | CooperativeLevel.NonExclusive); KeyboardDevice.Acquire(); KeyboardDevice.GetCurrentState(ref KeyState); mouseDevice = new SharpDX.DirectInput.Mouse(DirectInputInstance); if (mouseDevice == null) { throw new Exception("Failed to create mouse device"); } mouseDevice.SetCooperativeLevel(handle, CooperativeLevel.Background | CooperativeLevel.NonExclusive); mouseDevice.Properties.AxisMode = DeviceAxisMode.Relative; // Get delta values mouseDevice.Acquire(); getPressedStrategy = new GetPressedStrategy <int>(IsDown); setPressedStrategy = new SetPressedStrategy <int>(KeyOrButtonDown, KeyOrButtonUp); OnStarted(this, new EventArgs()); return(null); }
//fin tkz public Device(Joystick joystick, string pathlog, int id) { getPressedStrategy = new GetPressedStrategy <int>(IsDown); this.joystick = joystick; GetInfoStick(id, pathlog);//tkz joy SetRange(-16383, 16383); }
public override Action Start() { setPressedStrategy = new SetPressedStrategy <int>(KeyOrButtonDown, KeyOrButtonUp); getPressedStrategy = new GetPressedStrategy <int>(IsDown); KeysPressed = new List <int>(); ewh = new EventWaitHandle(false, EventResetMode.AutoReset, "ewhFreePIE"); memory = MemoryMappedFile.CreateOrOpen("hookFreePIE", 68, MemoryMappedFileAccess.ReadWrite); accessor = memory.CreateViewAccessor(); for (byte i = 0; i < 68; i++) { accessor.Write(i, 0); } if (!Debug) { Process.Start("FreePIE.HookInput.exe", hookstatus.ToString()); } return(null); }
//----------------------------------------------------------------------- public override System.Action Start() { IntPtr handle = Process.GetCurrentProcess().MainWindowHandle; MouseDevice = new Mouse(DirectInputInstance); if (MouseDevice == null) { throw new Exception("Failed to create mouse device"); } MouseDevice.SetCooperativeLevel(handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive); MouseDevice.Properties.AxisMode = DeviceAxisMode.Relative; // Get delta values MouseDevice.Acquire(); getButtonPressedStrategy = new GetPressedStrategy(IsButtonDown); setButtonPressedStrategy = new SetPressedStrategy(SetButtonDown, SetButtonUp); OnStarted(this, new EventArgs()); return(null); }
//----------------------------------------------------------------------- public override System.Action Start() { IntPtr handle = Process.GetCurrentProcess().MainWindowHandle; KeyboardDevice = new Keyboard(DirectInputInstance); if (KeyboardDevice == null) { throw new Exception("Failed to create keyboard device"); } KeyboardDevice.SetCooperativeLevel(handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive); KeyboardDevice.Acquire(); KeyboardDevice.GetCurrentState(ref KeyState); setKeyPressedStrategy = new SetPressedStrategy(KeyDown, KeyUp); getKeyPressedStrategy = new GetPressedStrategy <int>(IsKeyDown); OnStarted(this, new EventArgs()); return(null); }
public Device(Joystick joystick) { this.joystick = joystick; SetRange(-1000, 1000); getPressedStrategy = new GetPressedStrategy <int>(GetDown); }
public WiimoteButtonState(IWiimoteData data, out Action trigger) : base(out trigger) { this.data = data; buttonPressed = new GetPressedStrategy <WiimoteButtons>(button_down); }
public VarPlugin() { getPressedStrategy = new GetPressedStrategy <string>(IsVarDown); }