Ejemplo n.º 1
0
    get_key_name_lookup
)
from kitty.rgb import color_as_int
from kitty.types import FloatEdges, MouseEvent, SingleKey
from kitty.utils import expandvars, log_error

KeyMap = Dict[SingleKey, Tuple[KeyAction, ...]]
MouseMap = Dict[MouseEvent, Tuple[KeyAction, ...]]
KeySequence = Tuple[SingleKey, ...]
SubSequenceMap = Dict[KeySequence, Tuple[KeyAction, ...]]
SequenceMap = Dict[SingleKey, SubSequenceMap]
MINIMUM_FONT_SIZE = 4
default_tab_separator = ' ┇'
mod_map = {'⌃': 'CONTROL', 'CTRL': 'CONTROL', '⇧': 'SHIFT', '⌥': 'ALT', 'OPTION': 'ALT', 'OPT': 'ALT',
           '⌘': 'SUPER', 'COMMAND': 'SUPER', 'CMD': 'SUPER', 'KITTY_MOD': 'KITTY'}
character_key_name_aliases_with_ascii_lowercase: Dict[str, str] = character_key_name_aliases.copy()
for x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
    character_key_name_aliases_with_ascii_lowercase[x] = x.lower()
sequence_sep = '>'
FuncArgsType = Tuple[str, Sequence[Any]]
func_with_args = KeyFuncWrapper[FuncArgsType]()
DELETE_ENV_VAR = '_delete_this_env_var_'


class InvalidMods(ValueError):
    pass


# Actions {{{
@func_with_args(
    'pass_selection_to_program', 'new_window', 'new_tab', 'new_os_window',
Ejemplo n.º 2
0
MINIMUM_FONT_SIZE = 4
default_tab_separator = ' ┇'
mod_map = {
    '⌃': 'CONTROL',
    'CTRL': 'CONTROL',
    '⇧': 'SHIFT',
    '⌥': 'ALT',
    'OPTION': 'ALT',
    'OPT': 'ALT',
    '⌘': 'SUPER',
    'COMMAND': 'SUPER',
    'CMD': 'SUPER',
    'KITTY_MOD': 'KITTY'
}
character_key_name_aliases_with_ascii_lowercase: Dict[
    str, str] = character_key_name_aliases.copy()
for x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
    character_key_name_aliases_with_ascii_lowercase[x] = x.lower()
sequence_sep = '>'
mouse_button_map = {'left': 'b1', 'middle': 'b3', 'right': 'b2'}
mouse_trigger_count_map = {
    'doubleclick': -3,
    'click': -2,
    'release': -1,
    'press': 1,
    'doublepress': 2,
    'triplepress': 3
}
FuncArgsType = Tuple[str, Sequence[Any]]
func_with_args = KeyFuncWrapper[FuncArgsType]()
DELETE_ENV_VAR = '_delete_this_env_var_'