Skip to content
Snippets Groups Projects
Commit 89a6dd19 authored by George Nachman's avatar George Nachman
Browse files

Fix up and down arrows

parent a4a3c300
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -162,4 +162,6 @@
- (id)delegate;
 
- (void)setFont:(NSFont *)theFont;
- (void)disableArrowHandler;
@end
Loading
Loading
@@ -942,4 +942,9 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
}
}
 
- (void)disableArrowHandler
{
[searchField_ setArrowHandler:nil];
}
@end
Loading
Loading
@@ -24,6 +24,8 @@
[listView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[listView_ setDelegate:self];
[listView_ setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
[listView_ disableArrowHandler];
[self addSubview:listView_];
[listView_ release];
 
Loading
Loading
Loading
Loading
@@ -41,15 +41,14 @@
unsigned short keycode;
modflag = [theEvent modifierFlags];
keycode = [theEvent keyCode];
const int mask = NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask;
// TODO(georgen): Not getting normal keycodes here, but 125 and 126 are up and down arrows.
// This is a pretty ugly hack. Also, calling keyDown from here is probably not cool.
BOOL handled = NO;
if (!(mask & modflag) && (keycode == 125 || keycode == 126)) {
if (arrowHandler_ && !(mask & modflag) && (keycode == 125 || keycode == 126)) {
[arrowHandler_ keyDown:theEvent];
handled = YES;
} else {
handled = [super performKeyEquivalent:theEvent];
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment