add support for numpad keys
removed trailing whitespace, fixed indentation