If you're waiting for either the walk action to finish or the keypress to occur you should use the
viztask.waitAny command. Then if the event was a keypress you can leave the task using the
return command:
Code:
d = yield viztask.waitAny([waitSpaceBar,waitAction])
condition = d.condition
if condition == waitSpaceBar:
avatar.clearActions()
return