Filter key events on all browsers
Allow function in loop
Refactor filtering