Implement right mouse click on OS X when pressing control + click. This
restores the previous mouse behaviour as found in LWJGL 2.8.5 and below.
This commit is contained in:
parent
46cbd89430
commit
43a6a8bfbb
|
@ -57,6 +57,9 @@ static NSAutoreleasePool *pool;
|
|||
|
||||
static MacOSXPeerInfo *peer_info;
|
||||
|
||||
static bool leftMouseDown = false;
|
||||
static bool rightMouseDown = false;
|
||||
|
||||
@implementation MacOSXKeyableWindow
|
||||
|
||||
+ (void) createWindow {
|
||||
|
@ -348,6 +351,13 @@ static MacOSXPeerInfo *peer_info;
|
|||
}
|
||||
|
||||
- (void)mouseDown:(NSEvent *)event {
|
||||
if ([event modifierFlags] & NSControlKeyMask) {
|
||||
rightMouseDown = true;
|
||||
[self rightMouseDown:event];
|
||||
return;
|
||||
}
|
||||
|
||||
leftMouseDown = true;
|
||||
[self mouseButtonState:event :0 :1];
|
||||
}
|
||||
|
||||
|
@ -360,7 +370,15 @@ static MacOSXPeerInfo *peer_info;
|
|||
}
|
||||
|
||||
- (void)mouseUp:(NSEvent *)event {
|
||||
[self mouseButtonState:event :0 :0];
|
||||
if (rightMouseDown) {
|
||||
rightMouseDown = false;
|
||||
[self rightMouseUp:event];
|
||||
}
|
||||
|
||||
if (leftMouseDown) {
|
||||
leftMouseDown = false;
|
||||
[self mouseButtonState:event :0 :0];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)rightMouseUp:(NSEvent *)event {
|
||||
|
|
Loading…
Reference in New Issue