Fixed issue in key checking and added stuff for buttons