additional checks for keyboard - fix for issue #608

Thanks @PicklesIIDX and @crazysam