mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Ensure global shortcuts are never sent to children
This was happening with ctrl+tab and ctrl+shift+tab because cocoa eats these and so glfw has a workaround to always send them. If they are added as global shortcuts, for exmaple for next/previous tab they were then being sent to children
This commit is contained in:
@@ -168,6 +168,7 @@ class Boss:
|
|||||||
set_boss(self)
|
set_boss(self)
|
||||||
self.opts, self.args = opts, args
|
self.opts, self.args = opts, args
|
||||||
self.keymap = self.opts.keymap.copy()
|
self.keymap = self.opts.keymap.copy()
|
||||||
|
self.global_shortcuts_map = {v: KeyAction(k) for k, v in global_shortcuts.items()}
|
||||||
for sc in global_shortcuts.values():
|
for sc in global_shortcuts.values():
|
||||||
self.keymap.pop(sc, None)
|
self.keymap.pop(sc, None)
|
||||||
if is_macos:
|
if is_macos:
|
||||||
@@ -668,6 +669,8 @@ class Boss:
|
|||||||
self.pending_sequences = sequences
|
self.pending_sequences = sequences
|
||||||
set_in_sequence_mode(True)
|
set_in_sequence_mode(True)
|
||||||
return True
|
return True
|
||||||
|
if self.global_shortcuts_map and get_shortcut(self.global_shortcuts_map, ev):
|
||||||
|
return True
|
||||||
elif isinstance(key_action, KeyAction):
|
elif isinstance(key_action, KeyAction):
|
||||||
return self.dispatch_action(key_action)
|
return self.dispatch_action(key_action)
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ SequenceMap = Dict[SingleKey, SubSequenceMap]
|
|||||||
|
|
||||||
class KeyAction(NamedTuple):
|
class KeyAction(NamedTuple):
|
||||||
func: str
|
func: str
|
||||||
args: Sequence[str]
|
args: Sequence[str] = ()
|
||||||
|
|
||||||
|
|
||||||
func_with_args, args_funcs = key_func()
|
func_with_args, args_funcs = key_func()
|
||||||
|
|||||||
Reference in New Issue
Block a user