mirror of https://github.com/OpenTTD/OpenTTD
Fix: [OSX] An emulated right mouse down event has to be followed by right mouse up.
parent
649ff5f9f9
commit
9c8721922b
|
@ -451,6 +451,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
@implementation OTTD_CocoaView {
|
@implementation OTTD_CocoaView {
|
||||||
float _current_magnification;
|
float _current_magnification;
|
||||||
NSUInteger _current_mods;
|
NSUInteger _current_mods;
|
||||||
|
bool _emulated_down;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -564,6 +565,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
- (void)mouseDown:(NSEvent *)event
|
- (void)mouseDown:(NSEvent *)event
|
||||||
{
|
{
|
||||||
if ([ self emulateRightButton:event ]) {
|
if ([ self emulateRightButton:event ]) {
|
||||||
|
self->_emulated_down = true;
|
||||||
[ self rightMouseDown:event ];
|
[ self rightMouseDown:event ];
|
||||||
} else {
|
} else {
|
||||||
_left_button_down = true;
|
_left_button_down = true;
|
||||||
|
@ -572,7 +574,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
}
|
}
|
||||||
- (void)mouseUp:(NSEvent *)event
|
- (void)mouseUp:(NSEvent *)event
|
||||||
{
|
{
|
||||||
if ([ self emulateRightButton:event ]) {
|
if (self->_emulated_down) {
|
||||||
[ self rightMouseUp:event ];
|
[ self rightMouseUp:event ];
|
||||||
} else {
|
} else {
|
||||||
_left_button_down = false;
|
_left_button_down = false;
|
||||||
|
|
Loading…
Reference in New Issue