parent
2d70059f47
commit
18c108ed03
@ -18,6 +18,8 @@ Changelog
|
|||||||
- macOS: Ensure that when running from a bundle, the bundle kitty exe is
|
- macOS: Ensure that when running from a bundle, the bundle kitty exe is
|
||||||
preferred over any kitty in PATH (:iss:`1280`)
|
preferred over any kitty in PATH (:iss:`1280`)
|
||||||
|
|
||||||
|
- macOS: Fix a regression that broke mapping of :kbd:`ctrl+tab` (:iss:`1304`)
|
||||||
|
|
||||||
- Add a list of user-created kittens to the docs
|
- Add a list of user-created kittens to the docs
|
||||||
|
|
||||||
- Fix a regression that broke changing mouse wheel scroll direction with
|
- Fix a regression that broke changing mouse wheel scroll direction with
|
||||||
|
|||||||
@ -299,6 +299,14 @@ static GLFWbool initializeTIS(void)
|
|||||||
////// GLFW platform API //////
|
////// GLFW platform API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
is_ctrl_tab(NSEvent *event) {
|
||||||
|
NSEventModifierFlags modifierFlags = [event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask;
|
||||||
|
return event.keyCode == kVK_Tab && (modifierFlags == NSEventModifierFlagControl || modifierFlags == (
|
||||||
|
NSEventModifierFlagControl | NSEventModifierFlagShift));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int _glfwPlatformInit(void)
|
int _glfwPlatformInit(void)
|
||||||
{
|
{
|
||||||
_glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];
|
_glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||||
@ -312,8 +320,7 @@ int _glfwPlatformInit(void)
|
|||||||
|
|
||||||
NSEvent* (^keydown_block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
|
NSEvent* (^keydown_block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
|
||||||
{
|
{
|
||||||
NSEventModifierFlags modifierFlags = [event modifierFlags];
|
if (is_ctrl_tab(event)) {
|
||||||
if (event.keyCode == kVK_Tab && (modifierFlags == NSEventModifierFlagControl || modifierFlags == (NSEventModifierFlagControl | NSEventModifierFlagShift))) {
|
|
||||||
// Cocoa swallows Ctrl+Tab to cycle between views
|
// Cocoa swallows Ctrl+Tab to cycle between views
|
||||||
[[NSApp keyWindow].contentView keyDown:event];
|
[[NSApp keyWindow].contentView keyDown:event];
|
||||||
}
|
}
|
||||||
@ -323,14 +330,13 @@ int _glfwPlatformInit(void)
|
|||||||
|
|
||||||
NSEvent* (^keyup_block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
|
NSEvent* (^keyup_block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
|
||||||
{
|
{
|
||||||
NSEventModifierFlags modifierFlags = [event modifierFlags];
|
|
||||||
if ([event modifierFlags] & NSEventModifierFlagCommand) {
|
if ([event modifierFlags] & NSEventModifierFlagCommand) {
|
||||||
// From http://cocoadev.com/index.pl?GameKeyboardHandlingAlmost
|
// From http://cocoadev.com/index.pl?GameKeyboardHandlingAlmost
|
||||||
// This works around an AppKit bug, where key up events while holding
|
// This works around an AppKit bug, where key up events while holding
|
||||||
// down the command key don't get sent to the key window.
|
// down the command key don't get sent to the key window.
|
||||||
[[NSApp keyWindow] sendEvent:event];
|
[[NSApp keyWindow] sendEvent:event];
|
||||||
}
|
}
|
||||||
if (event.keyCode == kVK_Tab && (modifierFlags == NSEventModifierFlagControl || modifierFlags == (NSEventModifierFlagControl | NSEventModifierFlagShift))) {
|
if (is_ctrl_tab(event)) {
|
||||||
// Cocoa swallows Ctrl+Tab to cycle between views
|
// Cocoa swallows Ctrl+Tab to cycle between views
|
||||||
[[NSApp keyWindow].contentView keyUp:event];
|
[[NSApp keyWindow].contentView keyUp:event];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user