using System.Text;\r
using System.Diagnostics;\r
using System.Runtime.InteropServices;\r
-using SlimDX;\r
-using SlimDX.DirectInput;\r
+using SharpDX.DirectInput;\r
\r
namespace FDK\r
{\r
cinputkeyboard = new CInputKeyboard( hWnd, directInput );\r
cinputmouse = new CInputMouse( hWnd, directInput );\r
}\r
- catch ( DirectInputException )\r
+ catch\r
{\r
}\r
if (cinputkeyboard != null)\r
}\r
#endregion\r
#region [ Enumerate joypad ]\r
- foreach ( DeviceInstance instance in this.directInput.GetDevices( DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly ) )\r
+ foreach ( DeviceInstance instance in this.directInput.GetDevices( DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly ) )\r
{\r
this.list入力デバイス.Add( new CInputJoystick( hWnd, instance, directInput ) );\r
}\r
{\r
device.tポーリング(bWindowがアクティブ中, bバッファ入力を使用する);\r
}\r
- catch (DirectInputException) // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items.\r
+ catch (SharpDX.SharpDXException e) // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items.\r
{\r
- this.list入力デバイス.Remove(device);\r
- device.Dispose();\r
- Trace.TraceError("tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。");\r
+ if( e.ResultCode == ResultCode.OtherApplicationHasPriority )\r
+ {\r
+ // #xxxxx: 2017.5.9: from: このエラーの時は、何もしない。\r
+ }\r
+ else\r
+ {\r
+ // #xxxxx: 2017.5.9: from: その他のエラーの場合は、デバイスが外されたと想定してRemoveする。\r
+ this.list入力デバイス.Remove( device );\r
+ device.Dispose();\r
+ Trace.TraceError( "tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。" );\r
+ }\r
}\r
}\r
}\r