Commit fc4af29c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Hotkeys: Enable mouse wheel up/down and left/right usage. (mapped respectivly...

Hotkeys: Enable mouse wheel up/down and left/right usage. (mapped respectivly to volume up/down, and position forward/backward). This commit needs review.
parent 62f24677
...@@ -63,6 +63,8 @@ ...@@ -63,6 +63,8 @@
#define KEY_BACKSPACE 0x001C0000 #define KEY_BACKSPACE 0x001C0000
#define KEY_MOUSEWHEELUP 0x001D0000 #define KEY_MOUSEWHEELUP 0x001D0000
#define KEY_MOUSEWHEELDOWN 0x001E0000 #define KEY_MOUSEWHEELDOWN 0x001E0000
#define KEY_MOUSEWHEELLEFT 0x001F0000
#define KEY_MOUSEWHEELRIGHT 0x00200000
/* TODO: /* TODO:
* The media keys are only used in win32. Support for other OSes needs to * The media keys are only used in win32. Support for other OSes needs to
......
...@@ -163,9 +163,33 @@ static void Run( intf_thread_t *p_intf ) ...@@ -163,9 +163,33 @@ static void Run( intf_thread_t *p_intf )
/* Sleep a bit */ /* Sleep a bit */
// msleep( INTF_IDLE_SLEEP ); // msleep( INTF_IDLE_SLEEP );
/* Find action triggered by hotkey */
i_action = 0; i_action = 0;
i_key = GetKey( p_intf ); i_key = GetKey( p_intf );
/* Special action for mouse event */
/* FIXME: This should probably be configurable */
/* FIXME: rework hotkeys handling to allow more than 1 event
* to trigger one same action */
switch (i_key & KEY_SPECIAL)
{
case KEY_MOUSEWHEELUP:
i_action = ACTIONID_VOL_UP;
break;
case KEY_MOUSEWHEELDOWN:
i_action = ACTIONID_VOL_DOWN;
break;
case KEY_MOUSEWHEELLEFT:
i_action = ACTIONID_JUMP_BACKWARD_EXTRASHORT;
break;
case KEY_MOUSEWHEELRIGHT:
i_action = ACTIONID_JUMP_FORWARD_EXTRASHORT;
break;
default: break;
}
/* No mouse action, find action triggered by hotkey */
if(!i_action)
{
for( i = 0; i_key != -1 && p_hotkeys[i].psz_action != NULL; i++ ) for( i = 0; i_key != -1 && p_hotkeys[i].psz_action != NULL; i++ )
{ {
if( p_hotkeys[i].i_key == i_key ) if( p_hotkeys[i].i_key == i_key )
...@@ -177,6 +201,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -177,6 +201,7 @@ static void Run( intf_thread_t *p_intf )
break; break;
} }
} }
}
if( !i_action ) if( !i_action )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment