summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libvo/vo_gl.c6
-rw-r--r--libvo/vo_gl2.c6
-rw-r--r--libvo/vo_x11.c6
-rw-r--r--libvo/vo_xv.c6
-rw-r--r--libvo/x11_common.c16
5 files changed, 36 insertions, 4 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index db98b3ed7e..14d6deaa50 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -207,7 +207,11 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
// 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 --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index cb5ace9845..7b49ffb09e 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -711,7 +711,11 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
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 --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index ae6a347870..242bc0b9cc 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -421,7 +421,11 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
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 --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 24d0556b6c..8aa4007279 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -417,7 +417,11 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
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 --git a/libvo/x11_common.c b/libvo/x11_common.c
index 1b77e0c765..e5e5b498d4 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -29,6 +29,11 @@
#include <X11/extensions/xf86vmode.h>
#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 @@ int vo_x11_check_events(Display *mydisplay){
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