Commit 9056d31f authored by Jérome Decoodt's avatar Jérome Decoodt

Add Ctrl+clic to handle one button mice

parent 81ad2fc1
...@@ -456,35 +456,31 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -456,35 +456,31 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if( p_vout ) if( p_vout )
{ {
switch( [o_event type] ) if( ( [o_event type] == NSLeftMouseDown ) &&
( ! ( [o_event modifierFlags] & NSControlKeyMask ) ) )
{ {
case NSLeftMouseDown: if( [o_event clickCount] <= 1 )
{ {
if( [o_event clickCount] <= 1 ) /* single clicking */
{ var_Get( p_vout, "mouse-button-down", &val );
/* single clicking */ val.i_int |= 1;
var_Get( p_vout, "mouse-button-down", &val ); var_Set( p_vout, "mouse-button-down", val );
val.i_int |= 1;
var_Set( p_vout, "mouse-button-down", val );
}
else
{
/* multiple clicking */
[self toggleFullscreen];
}
} }
break; else
case NSRightMouseDown:
{ {
msg_Dbg( p_vout, "received NSRightMouseDown (generic method)" ); /* multiple clicking */
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; [self toggleFullscreen];
} }
break;
default:
[super mouseDown: o_event];
break;
} }
else if( ( [o_event type] == NSRightMouseDown ) ||
( ( [o_event type] == NSLeftMouseDown ) &&
( [o_event modifierFlags] & NSControlKeyMask ) ) )
{
msg_Dbg( p_vout, "received NSRightMouseDown (generic method) or Ctrl clic" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
}
else
[super mouseDown: o_event];
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment