mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
Intuitive mouse dragging on views supporting selection, improved click-through behaviour
This commit is contained in:
parent
22d84e0b21
commit
00ec6889f2
@ -432,7 +432,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
||||
- (void)mouseDown:(NSEvent *)event {
|
||||
NSPoint const location = [self convertPoint:[event locationInWindow] fromView:nil];
|
||||
NSUInteger const modifiers = [event modifierFlags];
|
||||
view->process_click((modifiers & NSCommandKeyMask) ? DCK_RIGHT_CLICK
|
||||
view->process_click(((modifiers & NSCommandKeyMask) && [[self window] isMainWindow]) ? DCK_RIGHT_CLICK
|
||||
: (modifiers & NSAlternateKeyMask) ? DCK_MIDDLE_CLICK
|
||||
: DCK_LEFT_CLICK,
|
||||
[self convertLocation:location]);
|
||||
@ -440,6 +440,20 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
||||
}
|
||||
|
||||
|
||||
- (void)mouseDragged:(NSEvent *)event {
|
||||
NSPoint const location = [self convertPoint:[event locationInWindow] fromView:nil];
|
||||
NSUInteger const modifiers = [event modifierFlags];
|
||||
if (view->cursor_supported()
|
||||
&& !(modifiers & NSAlternateKeyMask)
|
||||
&& (!(modifiers & NSCommandKeyMask) || ![[self window] isMainWindow]))
|
||||
{
|
||||
view->set_cursor_position([self convertLocation:location]);
|
||||
view->set_cursor_visible(true);
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)rightMouseDown:(NSEvent *)event {
|
||||
NSPoint const location = [self convertPoint:[event locationInWindow] fromView:nil];
|
||||
if (view->cursor_supported())
|
||||
|
Loading…
Reference in New Issue
Block a user