TIP-120 bi-direction motor control

I know the motor shield does this automatically.

Does it?

  switch (inByte) {
    case 'w':   
      motor1.setSpeed(225);
      motor1.run(FORWARD);     // Motor Runs Forward
      break;

    case 'k':   
      motor1.run(RELEASE);     // Motor Stops
      break;

    case 's':   
      motor1.setSpeed(225);
      motor1.run(BACKWARD);    // Motor Runs Backwards
      break;

I wrote this for another project that uses a motor shield. Even though there is a release for the motor to stop in this code,
if you press "w" and then immediately press "s" it will reverse the direction of the motor without needing to press the "k"
for the motor to stop. I would like to do something like this with relays. The motorshield system works perfectly, but
too low power for this project. Also I think the letter being pressed as would a temporary switch is a great idea too, if I
can figure it out.

So since I am not telling the motors in the code to stop before it reverses, I am assuming that it is in the library or somehow
else implemented.

Thanks.