Skip to content

Commit f151f45

Browse files
committed
Fixed issue with appending keys (flags were not being included)
Bumped the version up.
1 parent 599c1eb commit f151f45

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

Forms/KeyCaptureConfig.cs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ private void recentConfiguration_Click(object sender, EventArgs e)
303303
private void listViewKeys_SelectedIndexChanged(object sender, EventArgs e)
304304
{
305305
btnAppend.Enabled = (1 == listViewKeys.SelectedIndices.Count);
306+
btnAppendExtra.Enabled = (1 == listViewKeys.SelectedIndices.Count);
306307
btnRemove.Enabled = (0 < listViewKeys.SelectedIndices.Count);
307308
}
308309

@@ -337,7 +338,7 @@ private void numericUpDownDelay_ValueChanged(object sender, EventArgs e)
337338
private void btnAdd_Click(object sender, EventArgs e)
338339
{
339340
var zInput = (IODefinition)txtKeyIn.Tag;
340-
var zOutput = (IODefinition)txtKeyOut.Tag;
341+
var zOutput = getCurrentOutputDefinition();
341342

342343
if (null == zInput || null == zOutput)
343344
{
@@ -346,14 +347,6 @@ private void btnAdd_Click(object sender, EventArgs e)
346347
}
347348

348349
zInput.Flags = GetFlags(zInput, FlagsFromEnum.Input);
349-
if (checkOutputNone.Checked) // if output is set to none change zOutput keyarg
350-
{
351-
zOutput = new IODefinition((byte)IODefinition.IOFlags.DoNothing, 0x00);
352-
}
353-
else
354-
{
355-
zOutput.Flags = GetFlags(zOutput, FlagsFromEnum.Output);
356-
}
357350

358351
var zPairDef = new IOPairDefinition(zInput, zOutput);
359352

@@ -404,7 +397,7 @@ private void btnAppend_Click(object sender, EventArgs e)
404397

405398
var zItem = listViewKeys.SelectedItems[0];
406399
var zPairDef = (IOPairDefinition)zItem.Tag;
407-
var zOutDef = (IODefinition)txtKeyOut.Tag;
400+
var zOutDef = getCurrentOutputDefinition();
408401
var bSuccess = zPairDef.AddOutputDefinition(zOutDef);
409402
if (bSuccess)
410403
{
@@ -419,6 +412,25 @@ private void btnAppend_Click(object sender, EventArgs e)
419412
}
420413
}
421414

415+
private IODefinition getCurrentOutputDefinition()
416+
{
417+
var zOutput = (IODefinition)txtKeyOut.Tag;
418+
if (zOutput == null)
419+
{
420+
return null;
421+
}
422+
423+
if (checkOutputNone.Checked) // if output is set to none change zOutput keyarg
424+
{
425+
zOutput = new IODefinition((byte)IODefinition.IOFlags.DoNothing, 0x00);
426+
}
427+
else
428+
{
429+
zOutput.Flags = GetFlags(zOutput, FlagsFromEnum.Output);
430+
}
431+
return zOutput;
432+
}
433+
422434
private void btnStart_Click(object sender, EventArgs e)
423435
{
424436
if (0 == listViewKeys.Items.Count)

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.0.0.13")]
35-
[assembly: AssemblyFileVersion("0.0.0.13")]
34+
[assembly: AssemblyVersion("0.0.0.14")]
35+
[assembly: AssemblyFileVersion("0.0.0.14")]

0 commit comments

Comments
 (0)