mirror of https://github.com/mpv-player/mpv
Added new input mouse support in x11 vo
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4659 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
1bf9249b8c
commit
30c218a61b
|
@ -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");
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue