Change behavior of button/code?

Hi all,

Ok, so I have a project that I'm using someone else's code for handling pushing a button. The code found here:

http://forum.arduino.cc/index.php?topic=14479.0

Which works great.

Here's a link to my full sketch:

(I would have just put my code here on this post, but I kept getting an error saying that exceeds the maximum 'character' limit)

Sooo, what I'd like to do/change about this code is the behavior of the button when you 'hold it down'. Currently it reacts similar to the other button 'events' - it turns on an LED, runs the motor for a pre-determined amount of time, then turns the LED back off:

void holdEvent(int whichButtonWasPushed) {
   // Code for when a hold (long press) is detected
   
   if (whichButtonWasPushed == 1) {
     // Button A was pushed
     digitalWrite(LEDA, HIGH);  // turn status LEDA on
     moveMotorHighLevel(secondsToTurnMotorAViaLongPressButtonA, motorA); // Motor A
     digitalWrite(LEDA, LOW); // turn status LEDA off
   } else {
     // Button B was pushed
     digitalWrite(LEDB, HIGH);  // turn status LEDB on
     moveMotorHighLevel(secondsToTurnMotorBViaLongPressButtonB, motorB); // Motor B
     digitalWrite(LEDB, LOW); // turn status LEDB off
   }

} // holdEvent()

I decided that for the 'long press event' (the hold event) I would like to actually have the motor turn on and stay on for the duration of holding the button down.

I've played around with the code that actually handles the various types of button presses:

//=================================================
//  MULTI-CLICK:  One Button, Multiple Events

// Button timing variables
int debounce = 20;          // ms debounce period to prevent flickering when pressing or releasing the button
int DCgap = 250;            // max ms between clicks for a double click event
int holdTime = 2000;        // ms hold period: how long to wait for press+hold event


// Button variables
boolean buttonVal = HIGH;   // value read from button
boolean buttonLast = HIGH;  // buffered value of the button's previous state
boolean DCwaiting = false;  // whether we're waiting for a double click (down)
boolean DConUp = false;     // whether to register a double click on next release, or whether to wait and click
boolean singleOK = true;    // whether it's OK to do a single click
long downTime = -1;         // time the button was pressed down
long upTime = -1;           // time the button was released
boolean ignoreUp = false;   // whether to ignore the button release because the click+hold was triggered
boolean waitForUp = false;        // when held, whether to wait for the up event
boolean holdEventPast = false;    // whether or not the hold event happened already


int checkButtonA() {    
   int event = 0;
   buttonVal = digitalRead(BUTTONA);
   // Button pressed down
   if (buttonVal == LOW && buttonLast == HIGH && (millis() - upTime) > debounce)
   {
       downTime = millis();
       ignoreUp = false;
       waitForUp = false;
       singleOK = true;
       holdEventPast = false;
       
       if ((millis()-upTime) < DCgap && DConUp == false && DCwaiting == true)  DConUp = true;
       else  DConUp = false;
       DCwaiting = false;
   }
   // Button released
   else if (buttonVal == HIGH && buttonLast == LOW && (millis() - downTime) > debounce)
   {        
       if (not ignoreUp)
       {
           upTime = millis();
           if (DConUp == false) DCwaiting = true;
           else
           {
               event = 2;
               DConUp = false;
               DCwaiting = false;
               singleOK = false;
           }
       }
   }
   // Test for normal click event: DCgap expired
   if ( buttonVal == HIGH && (millis()-upTime) >= DCgap && DCwaiting == true && DConUp == false && singleOK == true && event != 2)
   {
       event = 1;
       DCwaiting = false;
   }
   // Test for hold
   if (buttonVal == LOW && (millis() - downTime) >= holdTime) {
       // Trigger "normal" hold
       if (not holdEventPast)
       {
           event = 3;
           waitForUp = true;
           ignoreUp = true;
           DConUp = false;
           DCwaiting = false;
           //downTime = millis();
           holdEventPast = true;
       }

   }
   buttonLast = buttonVal;
   return event;
} // checkButtonA()

More specifically, I tried changing a couple of the variables such as:
ignoreUp, waitForUp
but It didn't really seem to change anything. Since I didn't write the code, I'm having a hard time figuring out what/how to actually change it to do this.

Maybe since this code for the button wasn't really written to behave like this, it's not possible to do without completely re-writing the entire button code?