update keyboard handler, add rotate logic to core