[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Centralize hotkeys controller to fix audio playback pause
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun Nov 15 20:05:04 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
f3301bb4 by bobbrysonn at 2026-11-15T20:38:47+01:00
macosx: Centralize hotkeys controller to fix audio playback pause
- - - - -
1a34ae0f by bobbrysonn at 2026-11-15T20:38:47+01:00
macosx: Fix spacebar hotkey for audio playback
- - - - -
5 changed files:
- modules/gui/macosx/library/VLCLibraryWindow.m
- modules/gui/macosx/main/VLCMain.h
- modules/gui/macosx/main/VLCMain.m
- modules/gui/macosx/windows/VLCDetachedAudioWindow.m
- modules/gui/macosx/windows/video/VLCVoutView.m
Changes:
=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -22,6 +22,7 @@
#import "VLCLibraryWindow.h"
+#import <Carbon/Carbon.h>
#import <QuartzCore/CAMediaTimingFunction.h>
#import <vlc_common.h>
@@ -31,6 +32,8 @@
#import "VLCLibraryDataTypes.h"
+#import "coreinteraction/VLCHotkeysController.h"
+
#import "extensions/NSAnimationContext+VLCAdditions.h"
#import "extensions/NSColor+VLCAdditions.h"
#import "extensions/NSFont+VLCAdditions.h"
@@ -852,4 +855,22 @@ static int ShowController(vlc_object_t * __unused p_this,
}
}
+- (void)keyDown:(NSEvent *)event
+{
+ if (event.keyCode == kVK_Space) {
+ if (self.firstResponder != self.librarySearchField) {
+ // First try performKeyEquivalent on the first responder
+ if ([self.firstResponder respondsToSelector:@selector(performKeyEquivalent:)] &&
+ [self.firstResponder performKeyEquivalent:event]) {
+ return;
+ }
+
+ // Only use hotkey if no one else handled it
+ if ([VLCMain.sharedInstance.hotkeysController performKeyEquivalent:event])
+ return;
+ }
+ }
+ [super keyDown:event];
+}
+
@end
=====================================
modules/gui/macosx/main/VLCMain.h
=====================================
@@ -67,6 +67,7 @@ extern NSString * const kVLCPreferencesVersion;
@class VLCPlayQueueController;
@class VLCVideoOutputProvider;
@class VLCDetachedAudioWindow;
+ at class VLCHotkeysController;
#ifdef HAVE_SPARKLE
@class SPUStandardUpdaterController;
#endif
@@ -83,6 +84,7 @@ extern NSString * const kVLCPreferencesVersion;
@property (readonly) VLCConvertAndSaveWindowController *convertAndSaveWindow;
@property (readonly) VLCCoreDialogProvider *coreDialogProvider;
@property (readonly) VLCExtensionsManager *extensionsManager;
+ at property (readonly) VLCHotkeysController *hotkeysController;
@property (readonly) VLCLogWindowController *debugMsgPanel;
@property (readonly) VLCLibraryController *libraryController;
@property (readonly) VLCLibraryWindow *libraryWindow;
=====================================
modules/gui/macosx/main/VLCMain.m
=====================================
@@ -46,6 +46,8 @@
#include <Metal/Metal.h>
+#import "coreinteraction/VLCHotkeysController.h"
+
#import "extensions/NSString+Helpers.h"
#import "library/VLCLibraryController.h"
@@ -120,6 +122,7 @@ NSString * const kVLCPreferencesVersion = @"VLCPreferencesVersion";
VLCConvertAndSaveWindowController *_convertAndSaveWindow;
VLCClickerManager *_clickerManager;
VLCDetachedAudioWindow *_detachedAudioWindow;
+ VLCHotkeysController *_hotkeysController;
#ifdef HAVE_SPARKLE
SPUStandardUpdaterController *_sparkleUpdaterController;
#endif
@@ -316,6 +319,8 @@ static VLCMain *sharedInstance = nil;
_videoEffectsPanel = [[VLCVideoEffectsWindowController alloc] init];
_audioEffectsPanel = [[VLCAudioEffectsWindowController alloc] init];
+ _hotkeysController = [[VLCHotkeysController alloc] init];
+
if ([NSApp currentSystemPresentationOptions] & NSApplicationPresentationFullScreen)
[_playQueueController.playerController setFullscreen:YES];
}
=====================================
modules/gui/macosx/windows/VLCDetachedAudioWindow.m
=====================================
@@ -22,6 +22,8 @@
#import "VLCDetachedAudioWindow.h"
+#import "coreinteraction/VLCHotkeysController.h"
+
#import "extensions/NSString+Helpers.h"
#import "extensions/NSView+VLCAdditions.h"
@@ -108,6 +110,10 @@
[self closeAndAnimate:YES];
return YES;
}
+
+ if ([VLCMain.sharedInstance.hotkeysController performKeyEquivalent:event])
+ return YES;
+
return [super performKeyEquivalent:event];
}
=====================================
modules/gui/macosx/windows/video/VLCVoutView.m
=====================================
@@ -104,7 +104,7 @@
f_cumulated_magnification = 0.0;
_playerController = VLCMain.sharedInstance.playQueueController.playerController;
- _hotkeysController = [[VLCHotkeysController alloc] init];
+ _hotkeysController = VLCMain.sharedInstance.hotkeysController;
_eventQueue = dispatch_queue_create("org.videolan.vlc.vout.events", DISPATCH_QUEUE_SERIAL);
vlc_mutex_init(&_mutex);
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6bdf37de8e9399557883ec530f29c0b46c533c80...1a34ae0f111dd5ac4178929f7793c522c0394049
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6bdf37de8e9399557883ec530f29c0b46c533c80...1a34ae0f111dd5ac4178929f7793c522c0394049
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list