checks for held key state and avoids releasing keys that are held.