summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-21 11:05:21 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-21 11:05:21 +0000
commitff32ae1051778bb8a1904ab4f93d304208c666eb (patch)
tree8af216c68b6af6fc48cedecf4037dc993017f99a
parent63b14952d2f616a75cadf2ee7b3b0f3d578218a1 (diff)
downloadmpv-ff32ae1051778bb8a1904ab4f93d304208c666eb.tar.bz2
mpv-ff32ae1051778bb8a1904ab4f93d304208c666eb.tar.xz
Move code to ignore mouse wheel "down" events to fifo.c (needed because
they too easily cause those "buttons" to get stuck), reducing code duplication. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21982 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--fifo.c2
-rw-r--r--libvo/vo_sdl.c3
-rw-r--r--libvo/x11_common.c6
3 files changed, 2 insertions, 9 deletions
diff --git a/fifo.c b/fifo.c
index 35b8777697..bd9afc54b7 100644
--- a/fifo.c
+++ b/fifo.c
@@ -79,6 +79,8 @@ void mplayer_put_key(int code) {
(code & ~MP_KEY_DOWN) >= MOUSE_BTN0_DBL &&
(code & ~MP_KEY_DOWN) <= MOUSE_BTN9_DBL)
return;
+ // ignore mouse wheel down events since they can easily get stuck
+ if (code < (MOUSE_BTN3 | MP_KEY_DOWN) || code > (MOUSE_BTN4 | MP_KEY_DOWN))
mplayer_put_key_internal(code);
if (code & MP_KEY_DOWN) {
code &= ~MP_KEY_DOWN;
diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c
index dafd845091..0f8f74046c 100644
--- a/libvo/vo_sdl.c
+++ b/libvo/vo_sdl.c
@@ -1190,9 +1190,6 @@ static void check_events (void)
case SDL_MOUSEBUTTONDOWN:
if(vo_nomouse_input)
break;
- if(event.button.button == 4 || event.button.button == 5)
- mplayer_put_key(MOUSE_BTN0+event.button.button-1);
- else
mplayer_put_key((MOUSE_BTN0+event.button.button-1) | MP_KEY_DOWN);
break;
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 719eb43a42..3b2b821c0d 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -1106,12 +1106,6 @@ int vo_x11_check_events(Display * mydisplay)
mouse_waiting_hide = 1;
mouse_timer = GetTimerMS();
}
- // Ignore mouse wheel press event.
- if (Event.xbutton.button > 3)
- {
- mplayer_put_key(MOUSE_BTN0 + Event.xbutton.button - 1);
- break;
- }
#ifdef HAVE_NEW_GUI
// Ignore mouse button 1-3 under GUI.
if (use_gui && (Event.xbutton.button >= 1)