Commit 039185d4 authored by Antoine Cellerier's avatar Antoine Cellerier

Add support for keyboard multimedia keys on win32. This is of course untested.

parent b2d0c393
...@@ -60,6 +60,24 @@ ...@@ -60,6 +60,24 @@
#define KEY_MOUSEWHEELUP 0x001D0000 #define KEY_MOUSEWHEELUP 0x001D0000
#define KEY_MOUSEWHEELDOWN 0x001E0000 #define KEY_MOUSEWHEELDOWN 0x001E0000
/* TODO:
* The media keys are only used in win32. Support for other OSes needs to
* be added */
#define KEY_BROWSER_BACK 0x001F0000
#define KEY_BROWSER_FORWARD 0x00200000
#define KEY_BROWSER_REFRESH 0x00210000
#define KEY_BROWSER_STOP 0x00220000
#define KEY_BROWSER_SEARCH 0x00230000
#define KEY_BROWSER_FAVORITES 0x00240000
#define KEY_BROWSER_HOME 0x00250000
#define KEY_VOLUME_MUTE 0x00260000
#define KEY_VOLUME_DOWN 0x00270000
#define KEY_VOLUME_UP 0x00280000
#define KEY_MEDIA_NEXT_TRACK 0x00290000
#define KEY_MEDIA_PREV_TRACK 0x002a0000
#define KEY_MEDIA_STOP 0x002b0000
#define KEY_MEDIA_PLAY_PAUSE 0x002c0000
#define KEY_ASCII 0x0000007F #define KEY_ASCII 0x0000007F
#define KEY_UNSET 0 #define KEY_UNSET 0
...@@ -153,7 +171,21 @@ static const struct key_descriptor_s vlc_keys[] = ...@@ -153,7 +171,21 @@ static const struct key_descriptor_s vlc_keys[] =
{ "\\", '\\' }, { "\\", '\\' },
{ "[", '[' }, { "[", '[' },
{ "]", ']' }, { "]", ']' },
{ "*", '*' } { "*", '*' },
{ "Browser Back", KEY_BROWSER_BACK },
{ "Browser Forward", KEY_BROWSER_FORWARD },
{ "Browser Refresh", KEY_BROWSER_REFRESH },
{ "Browser Stop", KEY_BROWSER_STOP },
{ "Browser Search", KEY_BROWSER_SEARCH },
{ "Browser Favorites", KEY_BROWSER_FAVORITES },
{ "Browser Home", KEY_BROWSER_HOME },
{ "Volume Mute", KEY_VOLUME_MUTE },
{ "Volume Down", KEY_VOLUME_DOWN },
{ "Volume Up", KEY_VOLUME_UP },
{ "Media Next Track", KEY_MEDIA_NEXT_TRACK },
{ "Media Prev Track", KEY_MEDIA_PREV_TRACK },
{ "Media Stop", KEY_MEDIA_STOP },
{ "Media Play Pause", KEY_MEDIA_PLAY_PAUSE }
}; };
static inline char *KeyToString( int i_key ) static inline char *KeyToString( int i_key )
......
...@@ -72,6 +72,20 @@ Win32Loop::Win32Loop( intf_thread_t *pIntf ): OSLoop( pIntf ) ...@@ -72,6 +72,20 @@ Win32Loop::Win32Loop( intf_thread_t *pIntf ): OSLoop( pIntf )
virtKeyToVlcKey[VK_END] = KEY_END; virtKeyToVlcKey[VK_END] = KEY_END;
virtKeyToVlcKey[VK_PRIOR] = KEY_PAGEUP; virtKeyToVlcKey[VK_PRIOR] = KEY_PAGEUP;
virtKeyToVlcKey[VK_NEXT] = KEY_PAGEDOWN; virtKeyToVlcKey[VK_NEXT] = KEY_PAGEDOWN;
virtKeyToVlcKey[VK_BROWSER_BACK] = KEY_BROWSER_BACK;
virtKeyToVlcKey[VK_BROWSER_FORWARD] = KEY_BROWSER_FORWARD;
virtKeyToVlcKey[VK_BROWSER_REFRESH] = KEY_BROWSER_REFRESH;
virtKeyToVlcKey[VK_BROWSER_STOP] = KEY_BROWSER_STOP;
virtKeyToVlcKey[VK_BROWSER_SEARCH] = KEY_BROWSER_SEARCH;
virtKeyToVlcKey[VK_BROWSER_FAVORITES] = KEY_BROWSER_FAVORITES;
virtKeyToVlcKey[VK_BROWSER_HOME] = KEY_BROWSER_HOME;
virtKeyToVlcKey[VK_VOLUME_MUTE] = KEY_VOLUME_MUTE;
virtKeyToVlcKey[VK_VOLUME_DOWN] = KEY_VOLUME_DOWN;
virtKeyToVlcKey[VK_VOLUME_UP] = KEY_VOLUME_UP;
virtKeyToVlcKey[VK_MEDIA_NEXT_TRACK] = KEY_MEDIA_NEXT_TRACK;
virtKeyToVlcKey[VK_MEDIA_PREV_TRACK] = KEY_MEDIA_PREV_TRACK;
virtKeyToVlcKey[VK_MEDIA_STOP] = KEY_MEDIA_STOP;
virtKeyToVlcKey[VK_MEDIA_PLAY_PAUSE] = KEY_MEDIA_PLAY_PAUSE;
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <string.h> /* strerror() */ #include <string.h> /* strerror() */
#ifndef _WIN32_WINNT #ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0400 # define _WIN32_WINNT 0x0500
#endif #endif
#include <vlc/vlc.h> #include <vlc/vlc.h>
...@@ -875,6 +875,21 @@ static struct ...@@ -875,6 +875,21 @@ static struct
{ VK_SHIFT, 0 }, { VK_SHIFT, 0 },
{ VK_MENU, 0 }, { VK_MENU, 0 },
{ VK_BROWSER_BACK, KEY_BROWSER_BACK },
{ VK_BROWSER_FORWARD, KEY_BROWSER_FORWARD },
{ VK_BROWSER_REFRESH, KEY_BROWSER_REFRESH },
{ VK_BROWSER_STOP, KEY_BROWSER_STOP },
{ VK_BROWSER_SEARCH, KEY_BROWSER_SEARCH },
{ VK_BROWSER_FAVORITES, KEY_BROWSER_FAVORITES },
{ VK_BROWSER_HOME, KEY_BROWSER_HOME },
{ VK_VOLUME_MUTE, KEY_VOLUME_MUTE },
{ VK_VOLUME_DOWN, KEY_VOLUME_DOWN },
{ VK_VOLUME_UP, KEY_VOLUME_UP },
{ VK_MEDIA_NEXT_TRACK, KEY_MEDIA_NEXT_TRACK },
{ VK_MEDIA_PREV_TRACK, KEY_MEDIA_PREV_TRACK },
{ VK_MEDIA_STOP, KEY_MEDIA_STOP },
{ VK_MEDIA_PLAY_PAUSE, KEY_MEDIA_PLAY_PAUSE },
{ 0, 0 } { 0, 0 }
}; };
......
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