Skip to content

Commit f7ed7ef

Browse files
committed
View accepts FirstResponder (for key_press_events)
In macos backend, [View keyDown:] (connects Cocoa event loop to mpl key_press_events) was not being called because View did not accept being first responder.
1 parent 48b6c13 commit f7ed7ef

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

@@ -5660,6 +5661,11 @@ - (void)scrollWheel:(NSEvent*)event
56605661
PyGILState_Release(gstate);
56615662
}
56625663

5664+
- (BOOL)acceptsFirstResponder
5665+
{
5666+
return YES;
5667+
}
5668+
56635669
/* This is all wrong. Address of pointer is being passed instead of pointer, keynames don't
56645670
match up with what the front-end and does the front-end even handle modifier keys by themselves?
56655671

0 commit comments

Comments
 (0)