*: a new mouse gestures interface, currently supporting back, forward, quit

fullscreen and a nice debug message when you draw a clockwise square. Video
output modules needs to be modified for this to work, but it should be minor
in modules supporting dvd navigation.

btw: it should be easy to add new gestures, ideas appreciated
parent 6a741bd3
...@@ -28,6 +28,7 @@ EXTRA_DIST = \ ...@@ -28,6 +28,7 @@ EXTRA_DIST = \
codec/spudec/Modules.am \ codec/spudec/Modules.am \
control/lirc/Modules.am \ control/lirc/Modules.am \
control/rc/Modules.am \ control/rc/Modules.am \
control/Modules.am \
demux/Modules.am \ demux/Modules.am \
demux/aac/Modules.am \ demux/aac/Modules.am \
demux/avi/Modules.am \ demux/avi/Modules.am \
......
SOURCES_gestures = modules/control/gestures.c
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins * xcommon.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.13 2003/02/01 18:54:10 sam Exp $ * $Id: xcommon.c,v 1.14 2003/02/09 23:42:06 sigmunau Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -613,6 +613,9 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -613,6 +613,9 @@ static int ManageVideo( vout_thread_t *p_vout )
switch( ((XButtonEvent *)&xevent)->button ) switch( ((XButtonEvent *)&xevent)->button )
{ {
case Button1: case Button1:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 1;
var_Set( p_vout, "mouse-button-down", val );
/* detect double-clicks */ /* detect double-clicks */
if( ( ((XButtonEvent *)&xevent)->time - if( ( ((XButtonEvent *)&xevent)->time -
...@@ -624,12 +627,29 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -624,12 +627,29 @@ static int ManageVideo( vout_thread_t *p_vout )
p_vout->p_sys->i_time_button_last_pressed = p_vout->p_sys->i_time_button_last_pressed =
((XButtonEvent *)&xevent)->time; ((XButtonEvent *)&xevent)->time;
break; break;
case Button2:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 2;
var_Set( p_vout, "mouse-button-down", val );
break;
case Button3:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 4;
var_Set( p_vout, "mouse-button-down", val );
break;
case Button4: case Button4:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 8;
var_Set( p_vout, "mouse-button-down", val );
input_Seek( p_vout, 15, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); input_Seek( p_vout, 15, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
break; break;
case Button5: case Button5:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 16;
var_Set( p_vout, "mouse-button-down", val );
input_Seek( p_vout, -15, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); input_Seek( p_vout, -15, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
break; break;
} }
...@@ -640,13 +660,26 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -640,13 +660,26 @@ static int ManageVideo( vout_thread_t *p_vout )
switch( ((XButtonEvent *)&xevent)->button ) switch( ((XButtonEvent *)&xevent)->button )
{ {
case Button1: case Button1:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~1;
var_Set( p_vout, "mouse-button-down", val );
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
var_Set( p_vout, "mouse-clicked", val ); var_Set( p_vout, "mouse-clicked", val );
break; break;
case Button2:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~2;
var_Set( p_vout, "mouse-button-down", val );
break;
case Button3: case Button3:
{ {
intf_thread_t *p_intf; intf_thread_t *p_intf;
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~4;
var_Set( p_vout, "mouse-button-down", val );
p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF, p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_intf ) if( p_intf )
...@@ -656,6 +689,19 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -656,6 +689,19 @@ static int ManageVideo( vout_thread_t *p_vout )
} }
} }
break; break;
case Button4:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~8;
var_Set( p_vout, "mouse-button-down", val );
break;
case Button5:
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~16;
var_Set( p_vout, "mouse-button-down", val );
break;
} }
} }
/* Mouse move */ /* Mouse move */
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.211 2003/01/30 19:14:17 gbazin Exp $ * $Id: video_output.c,v 1.212 2003/02/09 23:42:06 sigmunau Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -327,6 +327,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, ...@@ -327,6 +327,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
/* Mouse coordinates */ /* Mouse coordinates */
var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER ); var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER ); var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL ); var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER ); var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
var_Create( p_vout, "key-pressed", VLC_VAR_STRING ); var_Create( p_vout, "key-pressed", VLC_VAR_STRING );
......
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