added second overload of key() callback

when prodiving a function as second parameter, this is bound as listener
to the key press event