@@ -190,7 +190,7 @@ private void txtKeyIn_KeyDown(object sender, KeyEventArgs e)
190190 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")));
193- UpdateTextBox ( ( TextBox ) sender , e , new OutputConfig ( 0x00 , ( byte ) e . KeyCode , 0 , e ) ) ;
193+ UpdateTextBox ( ( TextBox ) sender , e , new OutputConfig ( 0 , ( byte ) e . KeyCode , 0 , e ) ) ;
194194 }
195195
196196 private void UpdateTextBox < T > ( TextBox txtBox , KeyEventArgs e , T config ) where T : BaseIOConfig
@@ -321,7 +321,7 @@ private void comboBoxMouseOut_SelectedIndexChanged(object sender, EventArgs e)
321321 else
322322 {
323323 var zOutputConfig = new OutputConfig (
324- ( byte ) OutputConfig . OutputFlag . MouseOut ,
324+ ( int ) OutputConfig . OutputFlag . MouseOut ,
325325 ( byte ) ( OutputConfig . MouseButton ) comboBoxOutMouse . SelectedItem ) ;
326326 txtKeyOut . Text = zOutputConfig . GetDescription ( ) ;
327327 txtKeyOut . Tag = zOutputConfig ;
@@ -330,10 +330,22 @@ private void comboBoxMouseOut_SelectedIndexChanged(object sender, EventArgs e)
330330
331331 private void numericUpDownDelay_ValueChanged ( object sender , EventArgs e )
332332 {
333+ var nFlag = 0 ;
334+ if ( checkOutputDelay . Checked )
335+ {
336+ nFlag = ( int ) OutputConfig . OutputFlag . Delay ;
337+ }
338+ // TODO: support other types that use the param this way...
339+ if ( nFlag == 0 )
340+ {
341+ return ;
342+ }
343+
333344 var zOutputConfig = new OutputConfig (
334- ( byte ) OutputConfig . OutputFlag . Delay ,
345+ nFlag ,
335346 0 ,
336- ( int ) numericUpDownDelay . Value ) ;
347+ ( int ) numericUpDownOutputParameter . Value ) ;
348+
337349 var zDisplay = txtKeyOut ;
338350 zDisplay . Text = zOutputConfig . GetDescription ( ) ;
339351 zDisplay . Tag = zOutputConfig ;
@@ -427,29 +439,38 @@ private void checkOutputToggle_CheckedChanged(object sender, EventArgs e)
427439 {
428440 checkOutputUp . Checked = checkOutputToggle . Checked ;
429441 checkOutputDown . Checked = checkOutputToggle . Checked ;
442+
430443 checkOutputUp . Enabled = ! checkOutputToggle . Checked ;
431444 checkOutputDown . Enabled = ! checkOutputToggle . Checked ;
445+ checkOutputRepeat . Enabled = ! checkOutputToggle . Checked ;
446+ checkOutputDelay . Enabled = ! checkOutputToggle . Checked ;
447+ checkOutputNothing . Enabled = ! checkOutputToggle . Checked ;
432448
433449 checkOutputAlt . Enabled = ! checkOutputToggle . Checked ;
434450 checkOutputShift . Enabled = ! checkOutputToggle . Checked ;
435451 checkOutputControl . Enabled = ! checkOutputToggle . Checked ;
436452 if ( checkOutputToggle . Checked )
437453 {
438- checkOutputAlt . Checked = false ;
439- checkOutputShift . Checked = false ;
440- checkOutputControl . Checked = false ;
454+ checkOutputAlt . Checked =
455+ checkOutputShift . Checked =
456+ checkOutputControl . Checked =
457+ checkOutputRepeat . Checked =
458+ checkOutputDelay . Checked =
459+ checkOutputNothing . Checked = false ;
441460 }
442461 }
443462
444463 private void checkOutputDoNothing_CheckedChanged ( object sender , EventArgs e )
445464 {
446- comboBoxOutMouse . Enabled = ! checkOutputDoNothing . Checked ;
447- checkOutputAlt . Enabled = ! checkOutputDoNothing . Checked ;
448- checkOutputShift . Enabled = ! checkOutputDoNothing . Checked ;
449- checkOutputControl . Enabled = ! checkOutputDoNothing . Checked ;
450- checkOutputUp . Enabled = ! checkOutputDoNothing . Checked ;
451- checkOutputDown . Enabled = ! checkOutputDoNothing . Checked ;
452- checkOutputToggle . Enabled = ! checkOutputDoNothing . Checked ;
465+ 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 ;
453474 }
454475
455476 #endregion
@@ -496,7 +517,7 @@ private OutputConfig UpdateOutputFlags(OutputConfig zOutputConfig)
496517 var bAlt = checkOutputAlt . Checked ;
497518 var bControl = checkOutputControl . Checked ;
498519 var bShift = checkOutputShift . Checked ;
499- var bNone = checkOutputDoNothing . Checked ;
520+ var bNone = checkOutputNothing . Checked ;
500521 var bToggle = checkOutputToggle . Checked ;
501522 var bRepeat = checkOutputRepeat . Checked ;
502523 var bDown = checkOutputDown . Checked ;
@@ -515,6 +536,12 @@ private OutputConfig UpdateOutputFlags(OutputConfig zOutputConfig)
515536 nFlags = BitUtil . UpdateFlag ( nFlags , bDown , OutputConfig . OutputFlag . Down ) ;
516537 nFlags = BitUtil . UpdateFlag ( nFlags , bUp , OutputConfig . OutputFlag . Up ) ;
517538 zOutputConfig . Flags = nFlags ;
539+
540+ if ( bRepeat )
541+ {
542+ zOutputConfig . Parameter = ( int ) numericUpDownOutputParameter . Value ;
543+ }
544+
518545 return zOutputConfig ;
519546 }
520547
0 commit comments