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 @@
#define KEY_BACKSPACE 0x001C0000
#define KEY_MOUSEWHEELUP 0x001D0000
#define KEY_MOUSEWHEELDOWN 0x001E0000
#define KEY_MOUSEWHEELLEFT 0x001F0000
#define KEY_MOUSEWHEELRIGHT 0x00200000
/* TODO:
* 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 )
/* Sleep a bit */
// msleep( INTF_IDLE_SLEEP );
/* Find action triggered by hotkey */
i_action = 0;
i_key = GetKey( p_intf );
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;
}
}
/* 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++ )
{
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 )
{
......
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