Added a function to check if a key was released.