added nicer mouse button checking, and fixed the keyboard pressed method