HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/prompt_toolkit/key_binding/defaults.py
"""
Default key bindings.::

    key_bindings = load_key_bindings()
    app = Application(key_bindings=key_bindings)
"""

from __future__ import annotations

from prompt_toolkit.filters import buffer_has_focus
from prompt_toolkit.key_binding.bindings.basic import load_basic_bindings
from prompt_toolkit.key_binding.bindings.cpr import load_cpr_bindings
from prompt_toolkit.key_binding.bindings.emacs import (
    load_emacs_bindings,
    load_emacs_search_bindings,
    load_emacs_shift_selection_bindings,
)
from prompt_toolkit.key_binding.bindings.mouse import load_mouse_bindings
from prompt_toolkit.key_binding.bindings.vi import (
    load_vi_bindings,
    load_vi_search_bindings,
)
from prompt_toolkit.key_binding.key_bindings import (
    ConditionalKeyBindings,
    KeyBindingsBase,
    merge_key_bindings,
)

__all__ = [
    "load_key_bindings",
]


def load_key_bindings() -> KeyBindingsBase:
    """
    Create a KeyBindings object that contains the default key bindings.
    """
    all_bindings = merge_key_bindings(
        [
            # Load basic bindings.
            load_basic_bindings(),
            # Load emacs bindings.
            load_emacs_bindings(),
            load_emacs_search_bindings(),
            load_emacs_shift_selection_bindings(),
            # Load Vi bindings.
            load_vi_bindings(),
            load_vi_search_bindings(),
        ]
    )

    return merge_key_bindings(
        [
            # Make sure that the above key bindings are only active if the
            # currently focused control is a `BufferControl`. For other controls, we
            # don't want these key bindings to intervene. (This would break "ptterm"
            # for instance, which handles 'Keys.Any' in the user control itself.)
            ConditionalKeyBindings(all_bindings, buffer_has_focus),
            # Active, even when no buffer has been focused.
            load_mouse_bindings(),
            load_cpr_bindings(),
        ]
    )