OSDN Git Service

DirectInputのポーリング時、バックグラウンドに移るなどの要因で OtherApplicationHasPriority エラー「以外」が発生した場合にのみデバイ...
authorFROM <from@alto.ocn.ne.jp>
Mon, 8 May 2017 15:05:59 +0000 (00:05 +0900)
committerFROM <from@alto.ocn.ne.jp>
Mon, 8 May 2017 15:05:59 +0000 (00:05 +0900)
FDK17プロジェクト/コード/02.入力/CInput管理.cs
実行時フォルダ/DTXCreator.exe
実行時フォルダ/DTXManiaGR.exe
実行時フォルダ/dll/FDK.dll
実行時フォルダ/ja-JP/DTXCreator.resources.dll
実行時フォルダ/ja-JP/DTXManiaGR.resources.dll

index 28de3f3..fd2082f 100644 (file)
@@ -183,16 +183,19 @@ namespace FDK
                                        {\r
                                                device.tポーリング(bWindowがアクティブ中, bバッファ入力を使用する);\r
                                        }\r
-                                       catch (Exception e)                                                                             // #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
-                                               Trace.TraceError("tポーリング(): " + device.e入力デバイス種別.ToString() + " : " + e.Message);\r
-                                               if (device.e入力デバイス種別 == E入力デバイス種別.Joystick)\r
+                                               if( e.ResultCode == ResultCode.OtherApplicationHasPriority )\r
                                                {\r
-                                                       this.list入力デバイス.Remove(device);\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
+                                                       Trace.TraceError( "tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。" );\r
                                                }\r
-                                               // Keyboard, mouseは、外されても、何もしない\r
                                        }\r
                                }\r
                        }\r
index 22295ce..4272fbe 100644 (file)
Binary files a/実行時フォルダ/DTXCreator.exe and b/実行時フォルダ/DTXCreator.exe differ
index 85fcc11..58974de 100644 (file)
Binary files a/実行時フォルダ/DTXManiaGR.exe and b/実行時フォルダ/DTXManiaGR.exe differ
index aef69a8..f445376 100644 (file)
Binary files a/実行時フォルダ/dll/FDK.dll and b/実行時フォルダ/dll/FDK.dll differ
index e8cdfc3..8dc4c36 100644 (file)
Binary files a/実行時フォルダ/ja-JP/DTXCreator.resources.dll and b/実行時フォルダ/ja-JP/DTXCreator.resources.dll differ
index dd20710..b96b016 100644 (file)
Binary files a/実行時フォルダ/ja-JP/DTXManiaGR.resources.dll and b/実行時フォルダ/ja-JP/DTXManiaGR.resources.dll differ