Fixed code to implement the KBD_FLAGS_RELEASE flag properly.