Tried implementing the above-mentioned fix. Though that path was never reached whengetEventKeyState() returned false, does now with some extra changes.
Please check it in the next snapshot