Implement press_key and release_key