Additional handling of special keys

Prevent special keys from being handled until they have been released.
This hopefully fixes the weird repeating key problems.