def _load_builtins(self):
pymux = self.pymux<EOL>kb = KeyBindings()<EOL>has_prefix = HasPrefix(pymux)<EOL>waits_for_confirmation = WaitsForConfirmation(pymux)<EOL>prompt_or_command_focus = has_focus(COMMAND) | has_focus(PROMPT)<EOL>display_pane_numbers = Condition(lambda: pymux.display_pane_numbers)<EOL>in_scroll_buffer_not_searching = InScrollBufferNotSearching(pymux)<EOL>@kb.add(Keys.Any, filter=has_prefix)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>pymux.get_client_state().has_prefix = False<EOL><DEDENT>@kb.add('<STR_LIT>', filter=prompt_or_command_focus & ~has_prefix)<EOL>@kb.add('<STR_LIT>', filter=prompt_or_command_focus & ~has_prefix)<EOL><INDENT>@kb.add('<STR_LIT>', filter=has_focus(COMMAND) & ~has_prefix &<EOL>Condition(lambda: cli.buffers[COMMAND].text == '<STR_LIT>'))<EOL><DEDENT>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>pymux.leave_command_mode(append_to_history=False)<EOL><DEDENT>@kb.add('<STR_LIT:y>', filter=waits_for_confirmation)<EOL>@kb.add('<STR_LIT:Y>', filter=waits_for_confirmation)<EOL>def _(event):<EOL><INDENT>"""<STR_LIT>"""<EOL>client_state = pymux.get_client_state()<EOL>command = client_state.confirm_command<EOL>client_state.confirm_command = None<EOL>client_state.confirm_text = None<EOL>pymux.handle_command(command)<EOL><DEDENT>@kb.add('<STR_LIT:n>', filter=waits_for_confirmation)<EOL>@kb.add('<STR_LIT:N>', filter=waits_for_confirmation)<EOL>@kb.add('<STR_LIT>' , filter=waits_for_confirmation)<EOL>def _(event):<EOL><INDENT>"""<STR_LIT>"""<EOL>client_state = pymux.get_client_state()<EOL>client_state.confirm_command = None<EOL>client_state.confirm_text = None<EOL><DEDENT>@kb.add('<STR_LIT>', filter=in_scroll_buffer_not_searching)<EOL>@kb.add('<STR_LIT>', filter=in_scroll_buffer_not_searching)<EOL>@kb.add('<STR_LIT:q>', filter=in_scroll_buffer_not_searching)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>pane = pymux.arrangement.get_active_pane()<EOL>pane.exit_scroll_buffer()<EOL><DEDENT>@kb.add('<STR_LIT:U+0020>', filter=in_scroll_buffer_not_searching)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>event.current_buffer.start_selection(selection_type=SelectionType.CHARACTERS)<EOL><DEDENT>@kb.add('<STR_LIT>', filter=in_scroll_buffer_not_searching & has_selection)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>clipboard_data = event.current_buffer.copy_selection()<EOL>event.app.clipboard.set_data(clipboard_data)<EOL><DEDENT>@kb.add('<STR_LIT:v>', filter=in_scroll_buffer_not_searching & has_selection)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>types = [SelectionType.LINES, SelectionType.BLOCK, SelectionType.CHARACTERS]<EOL>selection_state = event.current_buffer.selection_state<EOL>try:<EOL><INDENT>index = types.index(selection_state.type)<EOL><DEDENT>except ValueError:  <EOL><INDENT>index = <NUM_LIT:0><EOL><DEDENT>selection_state.type = types[(index + <NUM_LIT:1>) % len(types)]<EOL><DEDENT>@Condition<EOL>def popup_displayed():<EOL><INDENT>return self.pymux.get_client_state().display_popup<EOL><DEDENT>@kb.add('<STR_LIT:q>', filter=popup_displayed, eager=True)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>self.pymux.get_client_state().display_popup = False<EOL><DEDENT>@kb.add(Keys.Any, eager=True, filter=display_pane_numbers)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>pymux.display_pane_numbers = False<EOL><DEDENT>@Condition<EOL>def clock_displayed():<EOL><INDENT>"<STR_LIT:U+0020>"<EOL>pane = pymux.arrangement.get_active_pane()<EOL>return pane.clock_mode<EOL><DEDENT>@kb.add(Keys.Any, eager=True, filter=clock_displayed)<EOL>def _(event):<EOL><INDENT>"<STR_LIT>"<EOL>pane = pymux.arrangement.get_active_pane()<EOL>pane.clock_mode = False<EOL><DEDENT>return kb<EOL>
Fill the Registry with the hard coded key bindings.