Skip to content

Commit deb9f1c

Browse files
committed
Merge pull request matplotlib#2262 from mrterry/mac_key_events
View accepts FirstResponder (for key_press_events)
2 parents fb265bd + f7ed7ef commit deb9f1c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/_macosx.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ - (const char*)convertKeyEvent:(NSEvent*)event;
419419
- (void)keyDown:(NSEvent*)event;
420420
- (void)keyUp:(NSEvent*)event;
421421
- (void)scrollWheel:(NSEvent *)event;
422+
- (BOOL)acceptsFirstResponder;
422423
//- (void)flagsChanged:(NSEvent*)event;
423424
@end
424425

@@ -5679,6 +5680,11 @@ - (void)scrollWheel:(NSEvent*)event
56795680
PyGILState_Release(gstate);
56805681
}
56815682

5683+
- (BOOL)acceptsFirstResponder
5684+
{
5685+
return YES;
5686+
}
5687+
56825688
/* This is all wrong. Address of pointer is being passed instead of pointer, keynames don't
56835689
match up with what the front-end and does the front-end even handle modifier keys by themselves?
56845690

0 commit comments

Comments
 (0)