forked from nst/CocoaSlideShow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSSWindow.m
More file actions
36 lines (30 loc) · 725 Bytes
/
CSSWindow.m
File metadata and controls
36 lines (30 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import "CSSWindow.h"
#import "AppDelegate.h"
@implementation CSSWindow
- (BOOL)preservesContentDuringLiveResize {
return NO;
}
// TODO: use notifications instead
- (void)keyDown:(NSEvent *)theEvent {
AppDelegate *css = (AppDelegate *)[[NSApplication sharedApplication] delegate];
//NSLog(@"-- %d", [theEvent keyCode]);
switch([theEvent keyCode]) {
case 49: // space
[css toggleSlideShow:self];
break;
case 53: // esc
[css exitFullScreen:self];
break;
case 123: // left
[css invalidateTimer];
[imagesController selectPreviousImage];
break;
case 124: // right
[css invalidateTimer];
[imagesController selectNextImage];
break;
default:
[super keyDown:theEvent];
}
}
@end