changed double equals to triple equals for keypress event