diff --git a/Base.lproj/MainMenu.xib b/Base.lproj/MainMenu.xib index 3cbc06bae..201c51973 100644 --- a/Base.lproj/MainMenu.xib +++ b/Base.lproj/MainMenu.xib @@ -298,11 +298,11 @@ - + - + @@ -773,6 +773,7 @@ Cog + diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index 1751d7017..ebd2c0dbd 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -198,6 +198,14 @@ { [playbackController play:self]; } + else if (modifiers == 0 && c == NSLeftArrowFunctionKey) + { + [playbackController eventSeekBackward:self]; + } + else if (modifiers == 0 && c == NSRightArrowFunctionKey) + { + [playbackController eventSeekForward:self]; + } // Escape else if (modifiers == 0 && c == 0x1b) { diff --git a/Window/MiniWindow.h b/Window/MiniWindow.h index 49f58caf8..1b2ee588c 100644 --- a/Window/MiniWindow.h +++ b/Window/MiniWindow.h @@ -7,9 +7,10 @@ // #import +#import "PlaybackController.h" @interface MiniWindow : NSWindow { - + IBOutlet PlaybackController *playbackController; } @end diff --git a/Window/MiniWindow.m b/Window/MiniWindow.m index 439be85ff..c66c426f1 100644 --- a/Window/MiniWindow.m +++ b/Window/MiniWindow.m @@ -36,5 +36,41 @@ // Do nothing! } +- (void)keyDown:(NSEvent *)e { + unsigned int modifiers = [e modifierFlags] & (NSCommandKeyMask | NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask); + NSString *characters = [e characters]; + unichar c; + + if ([characters length] != 1) + { + [super keyDown:e]; + + return; + } + + c = [characters characterAtIndex:0]; + if (modifiers == 0 && c == ' ') + { + [playbackController playPauseResume:self]; + } + else if (modifiers == 0 && (c == NSEnterCharacter || c == NSCarriageReturnCharacter)) + { + [playbackController play:self]; + } + else if (modifiers == 0 && c == NSLeftArrowFunctionKey) + { + [playbackController eventSeekBackward:self]; + } + else if (modifiers == 0 && c == NSRightArrowFunctionKey) + { + [playbackController eventSeekForward:self]; + } + else + { + [super keyDown:e]; + } + +} + @end