Merge branch 'master' of github.com:LaurentGomila/SFML
This commit is contained in:
commit
35bdbf6e2e
@ -520,11 +520,13 @@ NSUInteger KeepOnlyMaskFromData(NSUInteger data, NSUInteger mask);
|
||||
|
||||
|
||||
// Handle text entred event
|
||||
// We create a new event without command modifiers
|
||||
// We create a new event without command/ctrl modifiers
|
||||
// to prevent the OS from sending an alert
|
||||
NSUInteger modifiers = [theEvent modifierFlags] & NSCommandKeyMask
|
||||
? [theEvent modifierFlags] & ~NSCommandKeyMask
|
||||
: [theEvent modifierFlags];
|
||||
NSUInteger modifiers = [theEvent modifierFlags];
|
||||
|
||||
if (modifiers & NSCommandKeyMask) modifiers = modifiers & ~NSCommandKeyMask;
|
||||
if (modifiers & NSControlKeyMask) modifiers = modifiers & ~NSControlKeyMask;
|
||||
|
||||
NSEvent* ev = [NSEvent keyEventWithType:NSKeyDown
|
||||
location:[theEvent locationInWindow]
|
||||
modifierFlags:modifiers
|
||||
|
@ -32,14 +32,28 @@
|
||||
@implementation SFWindow
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
-(BOOL)acceptsFirstResponder {
|
||||
-(BOOL)acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
-(BOOL)canBecomeKeyWindow {
|
||||
-(BOOL)canBecomeKeyWindow
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
-(void)keyDown:(NSEvent *)theEvent
|
||||
{
|
||||
// Do nothing except preventing a system alert each time a key is pressed
|
||||
//
|
||||
// Special Consideration :
|
||||
// -----------------------
|
||||
// Consider overriding NSResponder -keyDown: message in a Cocoa view/window
|
||||
// that contains a SFML rendering area. Doing so will prevent a system
|
||||
// alert to be thrown everytime the user presses a key.
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user