This is called when a canvas that is showing this buffer has it's focus set. There will be at most one buffer that has the focus at any time. See also on-kill-focus
This method chains the buffer's keymap to the buffer's frame's keymap, if the buffer is in a frame. See get-keymap.