Handle rotation for keyboard