mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-09 12:32:21 +03:00
Handling keyboard events for local history view.
svn path=/trunk/netsurf/; revision=11851
This commit is contained in:
parent
86a2e0076d
commit
6d11881575
@ -274,7 +274,11 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt )
|
|||||||
|
|
||||||
- (void) keyDown: (NSEvent *)theEvent;
|
- (void) keyDown: (NSEvent *)theEvent;
|
||||||
{
|
{
|
||||||
[self interpretKeyEvents: [NSArray arrayWithObject: theEvent]];
|
if (!historyVisible) {
|
||||||
|
[self interpretKeyEvents: [NSArray arrayWithObject: theEvent]];
|
||||||
|
} else {
|
||||||
|
[history keyDown: theEvent];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) insertText: (id)string;
|
- (void) insertText: (id)string;
|
||||||
|
@ -35,4 +35,6 @@
|
|||||||
- (void) detach;
|
- (void) detach;
|
||||||
- (void) redraw;
|
- (void) redraw;
|
||||||
|
|
||||||
|
- (void) keyDown: (NSEvent *)theEvent;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#import "cocoa/LocalHistoryController.h"
|
#import "cocoa/LocalHistoryController.h"
|
||||||
|
|
||||||
|
#import "cocoa/BrowserView.h"
|
||||||
#import "cocoa/HistoryView.h"
|
#import "cocoa/HistoryView.h"
|
||||||
#import "cocoa/ArrowWindow.h"
|
#import "cocoa/ArrowWindow.h"
|
||||||
|
|
||||||
@ -101,4 +102,18 @@
|
|||||||
[history setNeedsDisplay: YES];
|
[history setNeedsDisplay: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) keyDown: (NSEvent *)theEvent;
|
||||||
|
{
|
||||||
|
unichar key = [[theEvent characters] characterAtIndex: 0];
|
||||||
|
switch (key) {
|
||||||
|
case 27:
|
||||||
|
[browser setHistoryVisible: NO];
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
NSBeep();
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Loading…
Reference in New Issue
Block a user