mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 00:06:25 +01:00
libvo input cleanup: remove the dependency on libinput,
remove most of the crappy mappings (like O->o or ESC->q). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16893 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
13cf9144bb
commit
374db42e17
@ -240,10 +240,27 @@ static mp_key_name_t key_names[] = {
|
||||
{ JOY_BTN8, "JOY_BTN8" },
|
||||
{ JOY_BTN9, "JOY_BTN9" },
|
||||
|
||||
{ KEY_XF86_PAUSE, "XF86_PAUSE" },
|
||||
{ KEY_XF86_STOP, "XF86_STOP" },
|
||||
{ KEY_XF86_PREV, "XF86_PREV" },
|
||||
{ KEY_XF86_NEXT, "XF86_NEXT" },
|
||||
{ KEY_POWER, "POWER" },
|
||||
{ KEY_MENU, "MENU" },
|
||||
{ KEY_PLAY, "PLAY" },
|
||||
{ KEY_PAUSE, "PAUSE" },
|
||||
{ KEY_PLAYPAUSE, "PLAYPAUSE" },
|
||||
{ KEY_STOP, "STOP" },
|
||||
{ KEY_FORWARD, "FORWARD" },
|
||||
{ KEY_REWIND, "REWIND" },
|
||||
{ KEY_NEXT, "NEXT" },
|
||||
{ KEY_PREV, "PREV" },
|
||||
{ KEY_VOLUME_UP, "VOLUME_UP" },
|
||||
{ KEY_VOLUME_DOWN, "VOLUME_DOWN" },
|
||||
{ KEY_MUTE, "MUTE" },
|
||||
|
||||
// These are kept for backward compatibility
|
||||
{ KEY_PAUSE, "XF86_PAUSE" },
|
||||
{ KEY_STOP, "XF86_STOP" },
|
||||
{ KEY_PREV, "XF86_PREV" },
|
||||
{ KEY_NEXT, "XF86_NEXT" },
|
||||
|
||||
{ KEY_CLOSE_WIN, "CLOSE_WIN" },
|
||||
|
||||
{ 0, NULL }
|
||||
};
|
||||
@ -282,9 +299,11 @@ static mp_cmd_bind_t def_cmd_binds[] = {
|
||||
{ { '}', 0 }, "speed_mult 2.0" },
|
||||
{ { KEY_BACKSPACE, 0 }, "speed_set 1.0" },
|
||||
{ { 'q', 0 }, "quit" },
|
||||
{ { 'Q', 0 }, "quit" },
|
||||
#ifndef HAVE_NEW_GUI
|
||||
{ { KEY_ESC, 0 }, "quit" },
|
||||
{ { 'p', 0 }, "pause" },
|
||||
{ { 'P', 0 }, "pause" },
|
||||
#endif
|
||||
{ { ' ', 0 }, "pause" },
|
||||
{ { '.', 0 }, "frame_step" },
|
||||
@ -298,6 +317,7 @@ static mp_cmd_bind_t def_cmd_binds[] = {
|
||||
{ { KEY_INS, 0 }, "alt_src_step 1" },
|
||||
{ { KEY_DEL, 0 }, "alt_src_step -1" },
|
||||
{ { 'o', 0 }, "osd" },
|
||||
{ { 'O', 0 }, "osd" },
|
||||
{ { 'z', 0 }, "sub_delay -0.1" },
|
||||
{ { 'x', 0 }, "sub_delay +0.1" },
|
||||
{ { 'g', 0 }, "sub_step -1" },
|
||||
@ -307,6 +327,7 @@ static mp_cmd_bind_t def_cmd_binds[] = {
|
||||
{ { '0', 0 }, "volume 1" },
|
||||
{ { '*', 0 }, "volume 1" },
|
||||
{ { 'm', 0 }, "mute" },
|
||||
{ { 'M', 0 }, "mute" },
|
||||
{ { '1', 0 }, "contrast -1" },
|
||||
{ { '2', 0 }, "contrast 1" },
|
||||
{ { '3', 0 }, "brightness -1" },
|
||||
@ -358,10 +379,21 @@ static mp_cmd_bind_t def_cmd_binds[] = {
|
||||
{ { 'w', 0 }, "panscan -0.1" },
|
||||
{ { 'e', 0 }, "panscan +0.1" },
|
||||
|
||||
{ { KEY_XF86_PAUSE, 0 }, "pause" },
|
||||
{ { KEY_XF86_STOP, 0 }, "quit" },
|
||||
{ { KEY_XF86_PREV, 0 }, "seek -60" },
|
||||
{ { KEY_XF86_NEXT, 0 }, "seek +60" },
|
||||
{ { KEY_POWER, 0 }, "quit" },
|
||||
{ { KEY_MENU, 0 }, "osd" },
|
||||
{ { KEY_PLAY, 0 }, "pause" },
|
||||
{ { KEY_PAUSE, 0 }, "pause" },
|
||||
{ { KEY_PLAYPAUSE, 0 }, "pause" },
|
||||
{ { KEY_STOP, 0 }, "quit" },
|
||||
{ { KEY_FORWARD, 0 }, "seek 60" },
|
||||
{ { KEY_REWIND, 0 }, "seek -60" },
|
||||
{ { KEY_NEXT, 0 }, "pt_step 1" },
|
||||
{ { KEY_PREV, 0 }, "pt_step -1" },
|
||||
{ { KEY_VOLUME_UP, 0 }, "volume 1" },
|
||||
{ { KEY_VOLUME_DOWN, 0 }, "volume -1" },
|
||||
{ { KEY_MUTE, 0 }, "mute" },
|
||||
|
||||
{ { KEY_CLOSE_WIN, 0 }, "quit" },
|
||||
|
||||
{ { 0 }, NULL }
|
||||
};
|
||||
|
@ -1439,7 +1439,7 @@ check_events( void )
|
||||
if (event.type == DIET_KEYPRESS) {
|
||||
switch (event.key_symbol) {
|
||||
case DIKS_ESCAPE:
|
||||
mplayer_put_key( 'q' );
|
||||
mplayer_put_key( KEY_ESC );
|
||||
break;
|
||||
case DIKS_PAGE_UP:
|
||||
mplayer_put_key( KEY_PAGE_UP );
|
||||
@ -1473,33 +1473,43 @@ check_events( void )
|
||||
break;
|
||||
|
||||
case DIKS_POWER:
|
||||
mplayer_put_key( 'q' );
|
||||
mplayer_put_key( KEY_POWER );
|
||||
break;
|
||||
case DIKS_MENU:
|
||||
mplayer_put_key( 'o' );
|
||||
mplayer_put_key( KEY_MENU );
|
||||
break;
|
||||
case DIKS_PLAY:
|
||||
mplayer_put_key( KEY_PLAY );
|
||||
break;
|
||||
case DIKS_STOP:
|
||||
mplayer_put_key( KEY_STOP );
|
||||
break;
|
||||
case DIKS_PAUSE:
|
||||
mplayer_put_key( KEY_PAUSE );
|
||||
break;
|
||||
case DIKS_PLAYPAUSE:
|
||||
mplayer_put_key( ' ' );
|
||||
mplayer_put_key( KEY_PLAYPAUSE );
|
||||
break;
|
||||
case DIKS_FORWARD:
|
||||
mplayer_put_key( KEY_FORWARD );
|
||||
break;
|
||||
case DIKS_NEXT:
|
||||
mplayer_put_key( KEY_PAGE_UP );
|
||||
mplayer_put_key( KEY_NEXT );
|
||||
break;
|
||||
case DIKS_REWIND:
|
||||
mplayer_put_key( KEY_REWIND );
|
||||
break;
|
||||
case DIKS_PREVIOUS:
|
||||
mplayer_put_key( KEY_PAGE_DOWN );
|
||||
mplayer_put_key( KEY_PREVIOUS );
|
||||
break;
|
||||
case DIKS_VOLUME_UP:
|
||||
mplayer_put_key( '0' );
|
||||
mplayer_put_key( KEY_VOLUME_UP );
|
||||
break;
|
||||
case DIKS_VOLUME_DOWN:
|
||||
mplayer_put_key( '9' );
|
||||
mplayer_put_key( KEY_VOLUME_DOWN );
|
||||
break;
|
||||
case DIKS_MUTE:
|
||||
mplayer_put_key( 'm' );
|
||||
mplayer_put_key( KEY_MUTE );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -909,7 +909,7 @@ if (buffer) {
|
||||
if (event.type == DIET_KEYPRESS) {
|
||||
switch (event.key_symbol) {
|
||||
case DIKS_ESCAPE:
|
||||
mplayer_put_key('q');
|
||||
mplayer_put_key(KEY_ESC);
|
||||
break;
|
||||
case DIKS_PAGE_UP: mplayer_put_key(KEY_PAGE_UP);break;
|
||||
case DIKS_PAGE_DOWN: mplayer_put_key(KEY_PAGE_DOWN);break;
|
||||
|
@ -889,7 +889,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
||||
}
|
||||
case WM_CLOSE:
|
||||
{
|
||||
mp_input_queue_cmd(mp_input_parse_cmd("quit"));
|
||||
mplayer_put_key(KEY_CLOSE_WIN);
|
||||
return 0;
|
||||
}
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
|
@ -378,7 +378,7 @@ static OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, EventRef eve
|
||||
switch ( theHICommand.commandID )
|
||||
{
|
||||
case kHICommandQuit:
|
||||
mplayer_put_key(KEY_ESC);
|
||||
mplayer_put_key(KEY_CLOSE_WIN);
|
||||
break;
|
||||
|
||||
case kHalfScreenCmd:
|
||||
@ -476,7 +476,7 @@ static OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, EventRef eve
|
||||
{
|
||||
case kEventWindowClosed:
|
||||
theWindow = NULL;
|
||||
mplayer_put_key(KEY_ESC);
|
||||
mplayer_put_key(KEY_CLOSE_WIN);
|
||||
break;
|
||||
|
||||
//resize window
|
||||
|
@ -1320,7 +1320,7 @@ static void check_events (void)
|
||||
}
|
||||
|
||||
break;
|
||||
case SDL_QUIT: mplayer_put_key('q');break;
|
||||
case SDL_QUIT: mplayer_put_key(KEY_CLOSE_WIN);break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
case WM_CLOSE:
|
||||
mp_input_queue_cmd(mp_input_parse_cmd("quit"));
|
||||
mplayer_put_key(KEY_CLOSE_WIN);
|
||||
break;
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ static int cursor = 1;
|
||||
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
switch (message) {
|
||||
case WM_CLOSE:
|
||||
mp_input_queue_cmd(mp_input_parse_cmd("quit"));
|
||||
mplayer_put_key(KEY_CLOSE_WIN);
|
||||
break;
|
||||
case WM_SYSCOMMAND:
|
||||
switch (wParam) {
|
||||
|
@ -548,16 +548,16 @@ void vo_x11_putkey_ext(int keysym)
|
||||
switch (keysym)
|
||||
{
|
||||
case XF86XK_AudioPause:
|
||||
mplayer_put_key(KEY_XF86_PAUSE);
|
||||
mplayer_put_key(KEY_PAUSE);
|
||||
break;
|
||||
case XF86XK_AudioStop:
|
||||
mplayer_put_key(KEY_XF86_STOP);
|
||||
mplayer_put_key(KEY_STOP);
|
||||
break;
|
||||
case XF86XK_AudioPrev:
|
||||
mplayer_put_key(KEY_XF86_PREV);
|
||||
mplayer_put_key(KEY_PREV);
|
||||
break;
|
||||
case XF86XK_AudioNext:
|
||||
mplayer_put_key(KEY_XF86_NEXT);
|
||||
mplayer_put_key(KEY_NEXT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -587,6 +587,9 @@ void vo_x11_putkey(int key)
|
||||
case wsEscape:
|
||||
mplayer_put_key(KEY_ESC);
|
||||
break;
|
||||
case wsTab:
|
||||
mplayer_put_key(KEY_TAB);
|
||||
break;
|
||||
case wsEnter:
|
||||
mplayer_put_key(KEY_ENTER);
|
||||
break;
|
||||
@ -647,14 +650,6 @@ void vo_x11_putkey(int key)
|
||||
case wsF12:
|
||||
mplayer_put_key(KEY_F + 12);
|
||||
break;
|
||||
case wsq:
|
||||
case wsQ:
|
||||
mplayer_put_key('q');
|
||||
break;
|
||||
case wsp:
|
||||
case wsP:
|
||||
mplayer_put_key('p');
|
||||
break;
|
||||
case wsMinus:
|
||||
case wsGrayMinus:
|
||||
mplayer_put_key('-');
|
||||
@ -728,15 +723,6 @@ void vo_x11_putkey(int key)
|
||||
case wsGrayEnter:
|
||||
mplayer_put_key(KEY_KPENTER);
|
||||
break;
|
||||
case wsm:
|
||||
case wsM:
|
||||
mplayer_put_key('m');
|
||||
break;
|
||||
case wso:
|
||||
case wsO:
|
||||
mplayer_put_key('o');
|
||||
break;
|
||||
|
||||
case wsGrave:
|
||||
mplayer_put_key('`');
|
||||
break;
|
||||
|
@ -34,12 +34,21 @@
|
||||
#define KEY_DOWN (KEY_CRSR+2)
|
||||
#define KEY_UP (KEY_CRSR+3)
|
||||
|
||||
/* XF86 Multimedia keyboard keys */
|
||||
#define KEY_XF86_BASE (0x100+384)
|
||||
#define KEY_XF86_PAUSE (KEY_XF86_BASE+1)
|
||||
#define KEY_XF86_STOP (KEY_XF86_BASE+2)
|
||||
#define KEY_XF86_PREV (KEY_XF86_BASE+3)
|
||||
#define KEY_XF86_NEXT (KEY_XF86_BASE+4)
|
||||
/* Multimedia keyboard/remote keys */
|
||||
#define KEY_MM_BASE (0x100+384)
|
||||
#define KEY_POWER (KEY_MM_BASE+0)
|
||||
#define KEY_MENU (KEY_MM_BASE+1)
|
||||
#define KEY_PLAY (KEY_MM_BASE+2)
|
||||
#define KEY_PAUSE (KEY_MM_BASE+3)
|
||||
#define KEY_PLAYPAUSE (KEY_MM_BASE+4)
|
||||
#define KEY_STOP (KEY_MM_BASE+5)
|
||||
#define KEY_FORWARD (KEY_MM_BASE+6)
|
||||
#define KEY_REWIND (KEY_MM_BASE+7)
|
||||
#define KEY_NEXT (KEY_MM_BASE+8)
|
||||
#define KEY_PREV (KEY_MM_BASE+9)
|
||||
#define KEY_VOLUME_UP (KEY_MM_BASE+10)
|
||||
#define KEY_VOLUME_DOWN (KEY_MM_BASE+11)
|
||||
#define KEY_MUTE (KEY_MM_BASE+12)
|
||||
|
||||
/* Keypad keys */
|
||||
#define KEY_KEYPAD (KEY_BASE+32)
|
||||
@ -57,3 +66,7 @@
|
||||
#define KEY_KPINS (KEY_KEYPAD+11)
|
||||
#define KEY_KPDEL (KEY_KEYPAD+12)
|
||||
#define KEY_KPENTER (KEY_KEYPAD+13)
|
||||
|
||||
/* Special keys */
|
||||
#define KEY_INTERN (0x1000)
|
||||
#define KEY_CLOSE_WIN (KEY_INTERN+0)
|
||||
|
Loading…
Reference in New Issue
Block a user