fixes #190

Please correct joystick key code before and validate the solution in this branch for this issue before merge.