implemented keyboard callbacks