コード例 #1
0
ファイル: XInput.cs プロジェクト: wahyuaditri/x360ce
 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
ファイル: XInput.cs プロジェクト: tanis2000/FEZ
 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
ファイル: XInput.cs プロジェクト: conankzhang/fez
        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);
        }
コード例 #5
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)
 {
     return(ErrorCodeHelper.ToResult(xinput.XInputGetKeystroke((int)this.userIndex, (int)deviceQueryType,
                                                               out keystroke)));
 }
コード例 #6
0
ファイル: Controller.cs プロジェクト: tanis2000/FEZ
 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
ファイル: XInput910.cs プロジェクト: alexey-bez/SharpDX
 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
ファイル: XInput14.cs プロジェクト: alexey-bez/SharpDX
 public int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
 {
     return XInput.XInputGetKeystroke(dwUserIndex, dwReserved, out keystrokeRef);
 }
コード例 #13
0
ファイル: XInput13.cs プロジェクト: alexey-bez/SharpDX
 public static extern int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef);
コード例 #14
0
ファイル: Controller.cs プロジェクト: alexey-bez/SharpDX
 /// <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;
 }