Improved key catching for mouse control