removeListener outside the listener?

Hey all, I’m having a little fight with my program…

I’m trying to set up a keyListener that would activate and deactivate under certain circumstances. For instance, it needs to deactivate if a key is not pushed a short time after something unrelated happens.

In order to do this, I’d need to have the removeListener method outside of the Listener function, but it doesn’t seem to remove anything when it’s not in the function. Is there something else I can do, or am I doing something wrong?

Thanks in advance! :smiley: