* playlist.cpp: Playlist control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: playlist.cpp,v 1.13 2003/06/09 12:33:16 asmax Exp $
+ * $Id: playlist.cpp,v 1.14 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
{
for( j = 0; j < NumOfItems; j++ )
{
- if( j == i + StartIndex )
- Select[j] = !Select[j];
+ if( button & KEY_CTRL )
+ {
+ // CTRL is pressed
+ if( j == i + StartIndex )
+ {
+ Select[j] = !Select[j];
+ }
+ }
+ else
+ {
+ // CTRL is not pressed
+ Select[j] = ( j == i + StartIndex );
+ }
}
RefreshAll();
return true;
* skin_common.h: Private Skin interface description
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: skin_common.h,v 1.16 2003/06/09 12:33:16 asmax Exp $
+ * $Id: skin_common.h,v 1.17 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include <X11/Xlib.h>
#endif
+// For mouse events FIXME: should be elsewhere?
+#define MOUSE_LEFT (1<<0)
+#define MOUSE_RIGHT (1<<1)
+#define KEY_CTRL (1<<2)
+
+
//---------------------------------------------------------------------------
// intf_sys_t: description and status of skin interface
//---------------------------------------------------------------------------
* window.cpp: Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: window.cpp,v 1.27 2003/06/09 12:33:16 asmax Exp $
+ * $Id: window.cpp,v 1.28 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
}
#ifndef BASIC_SKINS
- if( i < 0 && button == 2 )
+ if( i < 0 && button == MOUSE_RIGHT )
{
p_intf->p_sys->p_dialogs->ShowPopup();
}
* x11_window.cpp: X11 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: x11_window.cpp,v 1.19 2003/06/09 12:33:17 asmax Exp $
+ * $Id: x11_window.cpp,v 1.20 2003/06/09 14:04:20 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
int p2 = evt->GetParam2();
int time;
int posX, posY;
+ string type;
+ int button;
switch( msg )
{
XRaiseWindow( display, ( (X11Window *)(*win) )->GetHandle() );
XUNLOCK;
}
+
+ button = 0;
+ if( ((XButtonEvent *)p2 )->state & ControlMask )
+ {
+ // Control key pressed
+ button |= KEY_CTRL;
+ }
switch( ( (XButtonEvent *)p2 )->button )
{
case 1:
// Left button
+ button |= MOUSE_LEFT;
time = OSAPI_GetTime();
OSAPI_GetMousePos( posX, posY );
if( time - ClickedTime < DblClickDelay &&
// Double-click
ClickedTime = 0;
MouseDblClick( (int)( (XButtonEvent *)p2 )->x,
- (int)( (XButtonEvent *)p2 )->y, 1 );
+ (int)( (XButtonEvent *)p2 )->y, button );
}
else
{
ClickedY = posY;
LButtonDown = true;
MouseDown( (int)( (XButtonEvent *)p2 )->x,
- (int)( (XButtonEvent *)p2 )->y, 1 );
+ (int)( (XButtonEvent *)p2 )->y, button );
}
break;
case 3:
// Right button
+ button |= MOUSE_RIGHT;
RButtonDown = true;
MouseDown( (int)( (XButtonEvent *)p2 )->x,
- (int)( (XButtonEvent *)p2 )->y, 2 );
+ (int)( (XButtonEvent *)p2 )->y, button );
break;
default:
return true;
case ButtonRelease:
+ button = 0;
+ if( ((XButtonEvent *)p2 )->state & ControlMask )
+ {
+ // Control key pressed
+ button |= KEY_CTRL;
+ }
switch( ( (XButtonEvent *)p2 )->button )
{
case 1:
// Left button
+ button |= MOUSE_LEFT;
LButtonDown = false;
MouseUp( (int)( (XButtonEvent *)p2 )->x,
- (int)( (XButtonEvent *)p2 )->y, 1 );
+ (int)( (XButtonEvent *)p2 )->y, button );
break;
case 3:
+ button |= MOUSE_RIGHT;
// Right button
RButtonDown = false;
MouseUp( (int)( (XButtonEvent *)p2 )->x,
- (int)( (XButtonEvent *)p2 )->y, 2 );
+ (int)( (XButtonEvent *)p2 )->y, button );
break;
case 4:
return true;
case ClientMessage:
- {
XLOCK;
- string type = XGetAtomName( display, ( (XClientMessageEvent*)
- p2 )->message_type );
+ type = XGetAtomName( display, ( (XClientMessageEvent*)
+ p2 )->message_type );
XUNLOCK;
if( type == "XdndEnter" )
{
DropObject->DndDrop( ((XClientMessageEvent*)p2)->data.l );
return true;
}
- }
return false;
default: