Added utility to check if a key is down