# HG changeset patch # User albeu # Date 1013427890 0 # Node ID 93d562ad1c226cc88e9c72f5fad7e61c3a85c184 # Parent 610a11e4db36388731eb940d12f65b7213253039 Added new input mouse support in x11 vo diff -r 610a11e4db36 -r 93d562ad1c22 libvo/vo_gl.c --- a/libvo/vo_gl.c Mon Feb 11 11:42:08 2002 +0000 +++ b/libvo/vo_gl.c Mon Feb 11 11:44:50 2002 +0000 @@ -207,7 +207,11 @@ // bpp = myximage->bits_per_pixel; //XSelectInput(mDisplay, mywindow, StructureNotifyMask); // !!!! - XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask ); + XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask +#ifdef HAVE_NEW_INPUT + | ButtonPressMask | ButtonReleaseMask +#endif + ); // printf("Window setup ok\n"); diff -r 610a11e4db36 -r 93d562ad1c22 libvo/vo_gl2.c --- a/libvo/vo_gl2.c Mon Feb 11 11:42:08 2002 +0000 +++ b/libvo/vo_gl2.c Mon Feb 11 11:44:50 2002 +0000 @@ -711,7 +711,11 @@ XSync(mDisplay, False); //XSelectInput(mDisplay, mywindow, StructureNotifyMask); // !!!! - XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask ); + XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask +#ifdef HAVE_NEW_INPUT + | ButtonPressMask | ButtonReleaseMask +#endif + ); glVersion = glGetString(GL_VERSION); diff -r 610a11e4db36 -r 93d562ad1c22 libvo/vo_x11.c --- a/libvo/vo_x11.c Mon Feb 11 11:42:08 2002 +0000 +++ b/libvo/vo_x11.c Mon Feb 11 11:44:50 2002 +0000 @@ -421,7 +421,11 @@ if ( vo_window == None ) #endif { - XSelectInput( mDisplay,mywindow,StructureNotifyMask | KeyPressMask ); + XSelectInput( mDisplay,mywindow,StructureNotifyMask | KeyPressMask +#ifdef HAVE_NEW_INPUT + | ButtonPressMask | ButtonReleaseMask +#endif + ); } saver_off(mDisplay); return 0; diff -r 610a11e4db36 -r 93d562ad1c22 libvo/vo_xv.c --- a/libvo/vo_xv.c Mon Feb 11 11:42:08 2002 +0000 +++ b/libvo/vo_xv.c Mon Feb 11 11:44:50 2002 +0000 @@ -417,7 +417,11 @@ vo_x11_classhint( mDisplay,mywindow,"xv" ); vo_hidecursor(mDisplay,mywindow); - XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask ); + XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask +#ifdef HAVE_NEW_INPUT + | ButtonPressMask | ButtonReleaseMask +#endif + ); XSetStandardProperties(mDisplay, mywindow, hello, hello, None, NULL, 0, &hint); if ( mFullscreen ) vo_x11_decoration( mDisplay,mywindow,0 ); XMapWindow(mDisplay, mywindow); diff -r 610a11e4db36 -r 93d562ad1c22 libvo/x11_common.c --- a/libvo/x11_common.c Mon Feb 11 11:42:08 2002 +0000 +++ b/libvo/x11_common.c Mon Feb 11 11:44:50 2002 +0000 @@ -29,6 +29,11 @@ #include #endif +#ifdef HAVE_NEW_INPUT +#include "../input/input.h" +#include "../input/mouse.h" +#endif + /* * If SCAN_VISUALS is defined, vo_init() scans all available TrueColor * visuals for the 'best' visual for MPlayer video display. Note that @@ -425,6 +430,17 @@ vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) ); ret|=VO_EVENT_KEYPRESS; break; +#ifdef HAVE_NEW_INPUT + case ButtonPress: + // Ignore mouse whell press event + if(Event.xbutton.button == 4 || Event.xbutton.button == 5) + break; + mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN); + break; + case ButtonRelease: + mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1); + break; +#endif } } #ifdef HAVE_NEW_GUI