Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 //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);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        //-----------------------------------------------------------------------
        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);
        }
Exemplo n.º 5
0
        //-----------------------------------------------------------------------
        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);
        }
Exemplo n.º 6
0
 public Device(Joystick joystick)
 {
     this.joystick = joystick;
     SetRange(-1000, 1000);
     getPressedStrategy = new GetPressedStrategy <int>(GetDown);
 }
Exemplo n.º 7
0
 public WiimoteButtonState(IWiimoteData data, out Action trigger) : base(out trigger)
 {
     this.data     = data;
     buttonPressed = new GetPressedStrategy <WiimoteButtons>(button_down);
 }
Exemplo n.º 8
0
 public VarPlugin()
 {
     getPressedStrategy = new GetPressedStrategy <string>(IsVarDown);
 }