This pull request fixes bug 3800. Fix is for QA_3_5 branch. However it should be merged to master as well as the bug is present there also.
Fix bug #3800 Incorrect keyhandler behaviour #2
Thanks for the fix. Merged also to master but in a different file.