Пример #1
0
 public static unsafe ErrorCode XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke pKeystroke)
 {
     pKeystroke = new Keystroke();
     try { return(GetMethod <XInputGetKeystrokeDelegate>("XInputGetKeystroke")(dwUserIndex, dwReserved, out pKeystroke)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Пример #2
0
        /// <summary>
        /// Gets the keystroke.
        /// </summary>
        /// <param name="deviceQueryType">The flag.</param>
        /// <param name="keystroke">The keystroke.</param>
        /// <returns></returns>
        /// <unmanaged>unsigned int XInputGetKeystroke([In] XUSER_INDEX dwUserIndex,[In] unsigned int dwReserved,[Out] XINPUT_KEYSTROKE* pKeystroke)</unmanaged>
        public Result GetKeystroke(DeviceQueryType deviceQueryType, out Keystroke keystroke)
        {
            var result = ErrorCodeHelper.ToResult(XInput.XInputGetKeystroke((int)userIndex, (int)deviceQueryType, out keystroke));

            result.CheckError();
            return(result);
        }
Пример #3
0
 public static unsafe int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
 {
     keystrokeRef = new Keystroke();
       int keystroke;
       fixed (Keystroke* keystrokePtr = &keystrokeRef)
     keystroke = XInput.XInputGetKeystroke_(dwUserIndex, dwReserved, (void*) keystrokePtr);
       return keystroke;
 }
Пример #4
0
        public static unsafe int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
        {
            keystrokeRef = new Keystroke();
            int keystroke;

            fixed(Keystroke *keystrokePtr = &keystrokeRef)
            keystroke = XInput.XInputGetKeystroke_(dwUserIndex, dwReserved, (void *)keystrokePtr);

            return(keystroke);
        }
 /// <summary>Gets the keystroke.</summary>
 /// <param name="deviceQueryType">The flag.</param>
 /// <param name="keystroke">The keystroke.</param>
 /// <returns></returns>
 /// <unmanaged>unsigned int XInputGetKeystroke([In] XUSER_INDEX dwUserIndex,[In] unsigned int dwReserved,[Out] XINPUT_KEYSTROKE* pKeystroke)</unmanaged>
 public Result GetKeystroke(DeviceQueryType deviceQueryType, out Keystroke keystroke)
 {
     return(ErrorCodeHelper.ToResult(xinput.XInputGetKeystroke((int)this.userIndex, (int)deviceQueryType,
                                                               out keystroke)));
 }
Пример #6
0
 public Result GetKeystroke(DeviceQueryType deviceQueryType, out Keystroke keystroke)
 {
     Result result = ErrorCodeHelper.ToResult(XInput.XInputGetKeystroke((int) this.userIndex, (int) deviceQueryType, out keystroke));
       result.CheckError();
       return result;
 }
Пример #7
0
 public int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
 {
     return(XInput.XInputGetKeystroke(dwUserIndex, dwReserved, out keystrokeRef));
 }
Пример #8
0
		uint XInputGetKeystroke_Hooked(int dwUserIndex, int dwReserved, out Keystroke pKeystroke)
		{
			pKeystroke = new Keystroke();
			var controller = new Controller((UserIndex)dwUserIndex);
			if (controller.IsConnected)
			{
				try
				{
					var result = controller.GetKeystroke(DeviceQueryType.Any, out pKeystroke);
					return (uint) result.Code;
				}
				catch
				{
					return ERROR_DEVICE_NOT_CONNECTED;
				}
			}
			else
			{
				pKeystroke.UserIndex = UserIndex.One;
			}

			return ERROR_SUCCESS;
		}
Пример #9
0
 public int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
Пример #10
0
 public static extern int XInputGetKeystroke(
     int dwUserIndex,
     int dwReserved,
     out Keystroke keystrokeRef);
Пример #11
0
 public int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
Пример #12
0
 public int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
 {
     return XInput.XInputGetKeystroke(dwUserIndex, dwReserved, out keystrokeRef);
 }
Пример #13
0
 public static extern int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef);
Пример #14
0
 /// <summary>
 /// Gets the keystroke.
 /// </summary>
 /// <param name="deviceQueryType">The flag.</param>
 /// <param name="keystroke">The keystroke.</param>
 /// <returns></returns>
 /// <unmanaged>unsigned int XInputGetKeystroke([In] XUSER_INDEX dwUserIndex,[In] unsigned int dwReserved,[Out] XINPUT_KEYSTROKE* pKeystroke)</unmanaged>	
 public Result GetKeystroke(DeviceQueryType deviceQueryType, out Keystroke keystroke)
 {
     var result = ErrorCodeHelper.ToResult(xinput.XInputGetKeystroke((int)userIndex, (int)deviceQueryType, out keystroke));
     return result;
 }