Controls: Adding keydown/keyup events listener to window. Fixes #4311 and #4327.