[vlc-commits] Win32: make volume touch less sensitive
Jean-Baptiste Kempf
git at videolan.org
Thu Jan 22 15:41:24 CET 2015
vlc/vlc-2.2 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jan 8 03:43:43 2015 +0100| [870d113495244b165c9741d4de6626364db08891] | committer: Jean-Baptiste Kempf
Win32: make volume touch less sensitive
(cherry picked from commit 895f573f96fb4c2b439fdf45fc6eb63f1ec9a792)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=870d113495244b165c9741d4de6626364db08891
---
modules/video_output/msw/win32touch.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/msw/win32touch.c b/modules/video_output/msw/win32touch.c
index 122af40..be9fd71 100644
--- a/modules/video_output/msw/win32touch.c
+++ b/modules/video_output/msw/win32touch.c
@@ -48,7 +48,7 @@ LRESULT DecodeGesture( vlc_object_t *p_this, win32_gesture_sys_t *p_gesture,
/* Set the win32_gesture_sys_t values */
p_gesture->i_beginx = gi.ptsLocation.x;
p_gesture->i_beginy = gi.ptsLocation.y;
- p_gesture->i_lasty = -1;
+ p_gesture->i_lasty = p_gesture->i_beginy;
p_gesture->b_2fingers = false;
break;
case GID_END:
@@ -101,11 +101,16 @@ LRESULT DecodeGesture( vlc_object_t *p_this, win32_gesture_sys_t *p_gesture,
if( p_gesture->i_action == GESTURE_ACTION_VOLUME )
{
- int offset = p_gesture->i_beginy - gi.ptsLocation.y;
- if( offset > 0 )
+ int offset = p_gesture->i_lasty - gi.ptsLocation.y;
+
+ if( offset > 100)
var_SetInteger( p_this->p_libvlc, "key-action", ACTIONID_VOL_UP );
- else
+ else if( offset < -100)
var_SetInteger( p_this->p_libvlc, "key-action", ACTIONID_VOL_DOWN );
+ else
+ break;
+
+ p_gesture->i_lasty = gi.ptsLocation.y;
}
else if ( p_gesture->i_action == GESTURE_ACTION_BRIGHTNESS )
{
More information about the vlc-commits
mailing list