fix device disconnect
This commit is contained in:
@@ -80,8 +80,21 @@ namespace PJ64Savestater
|
|||||||
{
|
{
|
||||||
var inputCodes = new List<string>();
|
var inputCodes = new List<string>();
|
||||||
var state = new JoystickState();
|
var state = new JoystickState();
|
||||||
|
bool success;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
curPad.Poll();
|
curPad.Poll();
|
||||||
curPad.GetCurrentState(ref state);
|
curPad.GetCurrentState(ref state);
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
catch (SharpDX.SharpDXException)
|
||||||
|
{
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
|
||||||
for (int i = 0, loopTo = state.Buttons.Length - 1; i <= loopTo; i++)
|
for (int i = 0, loopTo = state.Buttons.Length - 1; i <= loopTo; i++)
|
||||||
{
|
{
|
||||||
@@ -246,6 +259,7 @@ namespace PJ64Savestater
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckForActions(string[] inputCodes)
|
private void CheckForActions(string[] inputCodes)
|
||||||
{
|
{
|
||||||
@@ -595,7 +609,7 @@ namespace PJ64Savestater
|
|||||||
|
|
||||||
private void radButton3_Click(object sender, EventArgs e)
|
private void radButton3_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var sfd_SaveInputProfile = new SaveFileDialog
|
var sfd_SaveInputProfile = new RadSaveFileDialog
|
||||||
{
|
{
|
||||||
Filter = FILTER_INPUTPROFILE
|
Filter = FILTER_INPUTPROFILE
|
||||||
};
|
};
|
||||||
@@ -605,7 +619,7 @@ namespace PJ64Savestater
|
|||||||
|
|
||||||
private void radButton4_Click(object sender, EventArgs e)
|
private void radButton4_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var ofd_SaveInputProfile = new OpenFileDialog
|
var ofd_SaveInputProfile = new RadOpenFileDialog
|
||||||
{
|
{
|
||||||
Filter = FILTER_INPUTPROFILE
|
Filter = FILTER_INPUTPROFILE
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user