mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 12:09:35 +03:00
parent
acdb56ad5d
commit
a143faaf05
@ -56,6 +56,7 @@ Changelog
|
||||
GPU machines. I give up, Apple users will just have to live with the
|
||||
limitations of their choice of OS. (:iss:`794`)
|
||||
|
||||
- macOS: Fix control+tab key combination not working (:iss:`801`)
|
||||
|
||||
0.11.3 [2018-07-10]
|
||||
------------------------------
|
||||
|
@ -1061,18 +1061,39 @@ is_ascii_control_char(char x) {
|
||||
|
||||
@implementation GLFWApplication
|
||||
|
||||
// From http://cocoadev.com/index.pl?GameKeyboardHandlingAlmost
|
||||
// This works around an AppKit bug, where key up events while holding
|
||||
// down the command key don't get sent to the key window.
|
||||
- (void)sendEvent:(NSEvent *)event
|
||||
{
|
||||
if ([event type] == NSEventTypeKeyUp &&
|
||||
([event modifierFlags] & NSEventModifierFlagCommand))
|
||||
{
|
||||
[[self keyWindow] sendEvent:event];
|
||||
NSEventType etype = [event type];
|
||||
NSEventModifierFlags flags;
|
||||
switch(etype) {
|
||||
case NSEventTypeKeyUp:
|
||||
flags = [event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask;
|
||||
if (flags & NSEventModifierFlagCommand) {
|
||||
// From http://cocoadev.com/index.pl?GameKeyboardHandlingAlmost
|
||||
// This works around an AppKit bug, where key up events while holding
|
||||
// down the command key don't get sent to the key window.
|
||||
[[self keyWindow] sendEvent:event];
|
||||
return;
|
||||
}
|
||||
if (flags == NSEventModifierFlagControl && event.keyCode == kVK_Tab) {
|
||||
// Cocoa swallows Ctrl+Tab to cycle between views
|
||||
[[self keyWindow].contentView keyUp:event];
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case NSEventTypeKeyDown:
|
||||
flags = [event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask;
|
||||
if (flags == NSEventModifierFlagControl && event.keyCode == kVK_Tab) {
|
||||
// Cocoa swallows Ctrl+Tab to cycle between views
|
||||
[[self keyWindow].contentView keyDown:event];
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
else
|
||||
[super sendEvent:event];
|
||||
|
||||
[super sendEvent:event];
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user