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,20 +163,45 @@ static void Run( intf_thread_t *p_intf ) ...@@ -163,20 +163,45 @@ 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 );
for( i = 0; i_key != -1 && p_hotkeys[i].psz_action != NULL; i++ )
{ /* Special action for mouse event */
if( p_hotkeys[i].i_key == i_key ) /* FIXME: This should probably be configurable */
{ /* FIXME: rework hotkeys handling to allow more than 1 event
i_action = p_hotkeys[i].i_action; * to trigger one same action */
i_times = p_hotkeys[i].i_times; switch (i_key & KEY_SPECIAL)
/* times key pressed within max. delta time */ {
p_hotkeys[i].i_times = 0; case KEY_MOUSEWHEELUP:
break; 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++ )
{
if( p_hotkeys[i].i_key == i_key )
{
i_action = p_hotkeys[i].i_action;
i_times = p_hotkeys[i].i_times;
/* times key pressed within max. delta time */
p_hotkeys[i].i_times = 0;
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