mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
Merge pull request #88334 from passivestar/ctrl-tab-mac
[macOS] Fix `Ctrl+Tab` and `Ctrl+Shift+Tab` not working
This commit is contained in:
commit
3ed81a8f70
@ -6768,8 +6768,8 @@ EditorNode::EditorNode() {
|
||||
warning->add_button(TTR("Copy Text"), true, "copy");
|
||||
warning->connect("custom_action", callable_mp(this, &EditorNode::_copy_warning));
|
||||
|
||||
ED_SHORTCUT("editor/next_tab", TTR("Next Scene Tab"), KeyModifierMask::CMD_OR_CTRL + Key::TAB);
|
||||
ED_SHORTCUT("editor/prev_tab", TTR("Previous Scene Tab"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::TAB);
|
||||
ED_SHORTCUT("editor/next_tab", TTR("Next Scene Tab"), KeyModifierMask::CTRL + Key::TAB);
|
||||
ED_SHORTCUT("editor/prev_tab", TTR("Previous Scene Tab"), KeyModifierMask::CTRL + KeyModifierMask::SHIFT + Key::TAB);
|
||||
ED_SHORTCUT("editor/filter_files", TTR("Focus FileSystem Filter"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::ALT + Key::P);
|
||||
|
||||
command_palette = EditorCommandPalette::get_singleton();
|
||||
|
@ -699,10 +699,12 @@ DisplayServerMacOS::WindowData &DisplayServerMacOS::get_window(WindowID p_window
|
||||
}
|
||||
|
||||
void DisplayServerMacOS::send_event(NSEvent *p_event) {
|
||||
// Special case handling of command-period, which is traditionally a special
|
||||
// shortcut in macOS and doesn't arrive at our regular keyDown handler.
|
||||
// Special case handling of shortcuts that don't arrive at the regular keyDown handler
|
||||
if ([p_event type] == NSEventTypeKeyDown) {
|
||||
if ((([p_event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagCommand) && [p_event keyCode] == 0x2f) {
|
||||
NSEventModifierFlags flags = [p_event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask;
|
||||
|
||||
// Command-period
|
||||
if ((flags == NSEventModifierFlagCommand) && [p_event keyCode] == 0x2f) {
|
||||
Ref<InputEventKey> k;
|
||||
k.instantiate();
|
||||
|
||||
@ -715,6 +717,24 @@ void DisplayServerMacOS::send_event(NSEvent *p_event) {
|
||||
k->set_echo([p_event isARepeat]);
|
||||
|
||||
Input::get_singleton()->parse_input_event(k);
|
||||
return;
|
||||
}
|
||||
|
||||
// Ctrl+Tab and Ctrl+Shift+Tab
|
||||
if (((flags == NSEventModifierFlagControl) || (flags == (NSEventModifierFlagControl | NSEventModifierFlagShift))) && [p_event keyCode] == 0x30) {
|
||||
Ref<InputEventKey> k;
|
||||
k.instantiate();
|
||||
|
||||
get_key_modifier_state([p_event modifierFlags], k);
|
||||
k->set_window_id(DisplayServerMacOS::INVALID_WINDOW_ID);
|
||||
k->set_pressed(true);
|
||||
k->set_keycode(Key::TAB);
|
||||
k->set_physical_keycode(Key::TAB);
|
||||
k->set_key_label(Key::TAB);
|
||||
k->set_echo([p_event isARepeat]);
|
||||
|
||||
Input::get_singleton()->parse_input_event(k);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user