update keyboard event handler