@@ -191,6 +191,8 @@ private void txtKeyOut_KeyDown(object sender, KeyEventArgs e)
191191 {
192192 // Console.Out.WriteLine("Key Input: {0} 0x{1}".FormatString(e.KeyCode, e.KeyCode.ToString("x")));
193193 UpdateTextBox ( ( TextBox ) sender , e , new OutputConfig ( 0 , ( byte ) e . KeyCode , 0 , e ) ) ;
194+ // delay is toggled off if a key is specified
195+ checkOutputDelay . Checked = false ;
194196 }
195197
196198 private void UpdateTextBox < T > ( TextBox txtBox , KeyEventArgs e , T config ) where T : BaseIOConfig
@@ -328,6 +330,14 @@ private void comboBoxMouseOut_SelectedIndexChanged(object sender, EventArgs e)
328330 }
329331 }
330332
333+ private void checkOutputDelay_CheckedChanged ( object sender , EventArgs e )
334+ {
335+ if ( checkOutputDelay . Checked )
336+ {
337+ numericUpDownDelay_ValueChanged ( sender , e ) ;
338+ }
339+ }
340+
331341 private void numericUpDownDelay_ValueChanged ( object sender , EventArgs e )
332342 {
333343 var nFlag = 0 ;
@@ -346,9 +356,8 @@ private void numericUpDownDelay_ValueChanged(object sender, EventArgs e)
346356 0 ,
347357 ( int ) numericUpDownOutputParameter . Value ) ;
348358
349- var zDisplay = txtKeyOut ;
350- zDisplay . Text = zOutputConfig . GetDescription ( ) ;
351- zDisplay . Tag = zOutputConfig ;
359+ txtKeyOut . Text = zOutputConfig . GetDescription ( ) ;
360+ txtKeyOut . Tag = zOutputConfig ;
352361 }
353362
354363 private void btnAdd_Click ( object sender , EventArgs e )
@@ -452,25 +461,54 @@ private void checkOutputToggle_CheckedChanged(object sender, EventArgs e)
452461 if ( checkOutputToggle . Checked )
453462 {
454463 checkOutputAlt . Checked =
455- checkOutputShift . Checked =
456- checkOutputControl . Checked =
457- checkOutputRepeat . Checked =
458- checkOutputDelay . Checked =
459- checkOutputNothing . Checked = false ;
464+ checkOutputShift . Checked =
465+ checkOutputControl . Checked =
466+ checkOutputRepeat . Checked =
467+ checkOutputDelay . Checked =
468+ checkOutputNothing . Checked = false ;
460469 }
461470 }
462471
463472 private void checkOutputDoNothing_CheckedChanged ( object sender , EventArgs e )
464473 {
465474 comboBoxOutMouse . Enabled =
466- checkOutputAlt . Enabled =
467- checkOutputShift . Enabled =
468- checkOutputControl . Enabled =
469- checkOutputUp . Enabled =
470- checkOutputDown . Enabled =
471- checkOutputToggle . Enabled =
472- checkOutputDelay . Enabled =
473- checkOutputRepeat . Enabled = ! checkOutputNothing . Checked ;
475+ checkOutputAlt . Enabled =
476+ checkOutputShift . Enabled =
477+ checkOutputControl . Enabled =
478+ checkOutputUp . Enabled =
479+ checkOutputDown . Enabled =
480+ checkOutputToggle . Enabled =
481+ checkOutputDelay . Enabled =
482+ checkOutputRepeat . Enabled =
483+ checkOutputCancel . Enabled =
484+ ! checkOutputNothing . Checked ;
485+ if ( checkOutputNothing . Checked )
486+ {
487+ var zOutputConfig = new OutputConfig ( ( int ) OutputConfig . OutputFlag . DoNothing , 0 ) ;
488+ txtKeyOut . Text = zOutputConfig . GetDescription ( ) ;
489+ txtKeyOut . Tag = zOutputConfig ;
490+ }
491+ }
492+
493+ private void checkOutputCancel_CheckedChanged ( object sender , EventArgs e )
494+ {
495+ comboBoxOutMouse . Enabled =
496+ checkOutputAlt . Enabled =
497+ checkOutputShift . Enabled =
498+ checkOutputControl . Enabled =
499+ checkOutputUp . Enabled =
500+ checkOutputDown . Enabled =
501+ checkOutputToggle . Enabled =
502+ checkOutputDelay . Enabled =
503+ checkOutputRepeat . Enabled =
504+ checkOutputNothing . Enabled =
505+ ! checkOutputCancel . Checked ;
506+ if ( checkOutputCancel . Checked )
507+ {
508+ var zOutputConfig = new OutputConfig ( ( int ) OutputConfig . OutputFlag . CancelActiveOutputs , 0 ) ;
509+ txtKeyOut . Text = zOutputConfig . GetDescription ( ) ;
510+ txtKeyOut . Tag = zOutputConfig ;
511+ }
474512 }
475513
476514 #endregion
@@ -513,11 +551,17 @@ private InputConfig UpdateInputFlags(InputConfig zInputConfig)
513551
514552 private OutputConfig UpdateOutputFlags ( OutputConfig zOutputConfig )
515553 {
554+ if ( zOutputConfig . IsFlaggedAs ( OutputConfig . OutputFlag . DoNothing )
555+ || zOutputConfig . IsFlaggedAs ( OutputConfig . OutputFlag . CancelActiveOutputs ) )
556+ {
557+ return zOutputConfig ;
558+ }
559+
560+
516561 // get the flags from the check boxes (always, both mouse and keyboard support them in some fashion)
517562 var bAlt = checkOutputAlt . Checked ;
518563 var bControl = checkOutputControl . Checked ;
519564 var bShift = checkOutputShift . Checked ;
520- var bNone = checkOutputNothing . Checked ;
521565 var bToggle = checkOutputToggle . Checked ;
522566 var bRepeat = checkOutputRepeat . Checked ;
523567 var bDown = checkOutputDown . Checked ;
@@ -530,7 +574,6 @@ private OutputConfig UpdateOutputFlags(OutputConfig zOutputConfig)
530574 nFlags = BitUtil . UpdateFlag ( nFlags , zOutputConfig . IsFlaggedAs ( OutputConfig . OutputFlag . MouseOut ) , OutputConfig . OutputFlag . MouseOut ) ;
531575 nFlags = BitUtil . UpdateFlag ( nFlags , zOutputConfig . IsFlaggedAs ( OutputConfig . OutputFlag . Delay ) , OutputConfig . OutputFlag . Delay ) ;
532576
533- nFlags = BitUtil . UpdateFlag ( nFlags , bNone , OutputConfig . OutputFlag . DoNothing ) ;
534577 nFlags = BitUtil . UpdateFlag ( nFlags , bToggle , OutputConfig . OutputFlag . Toggle ) ;
535578 nFlags = BitUtil . UpdateFlag ( nFlags , bRepeat , OutputConfig . OutputFlag . Repeat ) ;
536579 nFlags = BitUtil . UpdateFlag ( nFlags , bDown , OutputConfig . OutputFlag . Down ) ;
@@ -664,5 +707,6 @@ private bool ValidateOutputHasAction(OutputConfig zOutputConfig)
664707 }
665708
666709 #endregion
710+
667711 }
668712}
0 commit comments