Mercurial > mplayer.hg
changeset 9891:150d1ef4204d
keypad and function (f1-f10) suppport (currently only vo_sdl and the terminal input code supports it). Patch by Vladimir Mosgalin <mosgalin@VM10124.spb.edu>
author | alex |
---|---|
date | Wed, 09 Apr 2003 17:05:39 +0000 |
parents | 237fcb766110 |
children | f6d1df877e89 |
files | input/input.c libvo/vo_sdl.c libvo/wskeys.h libvo/x11_common.c osdep/keycodes.h |
diffstat | 5 files changed, 118 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/input/input.c Wed Apr 09 16:21:42 2003 +0000 +++ b/input/input.c Wed Apr 09 17:05:39 2003 +0000 @@ -136,6 +136,30 @@ { KEY_LEFT, "LEFT" }, { KEY_DOWN, "DOWN" }, { KEY_UP, "UP" }, + { KEY_F+1, "F1" }, + { KEY_F+2, "F2" }, + { KEY_F+3, "F3" }, + { KEY_F+4, "F4" }, + { KEY_F+5, "F5" }, + { KEY_F+6, "F6" }, + { KEY_F+7, "F7" }, + { KEY_F+8, "F8" }, + { KEY_F+9, "F9" }, + { KEY_F+10, "F10" }, + { KEY_KP0, "KP0" }, + { KEY_KP1, "KP1" }, + { KEY_KP2, "KP2" }, + { KEY_KP3, "KP3" }, + { KEY_KP4, "KP4" }, + { KEY_KP5, "KP5" }, + { KEY_KP6, "KP6" }, + { KEY_KP7, "KP7" }, + { KEY_KP8, "KP8" }, + { KEY_KP9, "KP9" }, + { KEY_KPDEL, "KP_DEL" }, + { KEY_KPDEC, "KP_DEL" }, + { KEY_KPINS, "KP0" }, + { KEY_KPENTER, "KP_ENTER" }, { MOUSE_BTN0, "MOUSE_BTN0" }, { MOUSE_BTN1, "MOUSE_BTN1" }, { MOUSE_BTN2, "MOUSE_BTN2" },
--- a/libvo/vo_sdl.c Wed Apr 09 16:21:42 2003 +0000 +++ b/libvo/vo_sdl.c Wed Apr 09 17:05:39 2003 +0000 @@ -1256,6 +1256,16 @@ case SDLK_RETURN: mplayer_put_key(KEY_ENTER);break; case SDLK_ESCAPE: mplayer_put_key(KEY_ESC);break; case SDLK_q: mplayer_put_key('q');break; + case SDLK_F1: mplayer_put_key(KEY_F+1);break; + case SDLK_F2: mplayer_put_key(KEY_F+2);break; + case SDLK_F3: mplayer_put_key(KEY_F+3);break; + case SDLK_F4: mplayer_put_key(KEY_F+4);break; + case SDLK_F5: mplayer_put_key(KEY_F+5);break; + case SDLK_F6: mplayer_put_key(KEY_F+6);break; + case SDLK_F7: mplayer_put_key(KEY_F+7);break; + case SDLK_F8: mplayer_put_key(KEY_F+8);break; + case SDLK_F9: mplayer_put_key(KEY_F+9);break; + case SDLK_F10: mplayer_put_key(KEY_F+10);break; /*case SDLK_o: mplayer_put_key('o');break; case SDLK_SPACE: mplayer_put_key(' ');break; case SDLK_p: mplayer_put_key('p');break;*/ @@ -1289,6 +1299,18 @@ case SDLK_SLASH: case SDLK_KP_DIVIDE: mplayer_put_key('/'); break; #endif + case SDLK_KP0: mplayer_put_key(KEY_KP0); break; + case SDLK_KP1: mplayer_put_key(KEY_KP1); break; + case SDLK_KP2: mplayer_put_key(KEY_KP2); break; + case SDLK_KP3: mplayer_put_key(KEY_KP3); break; + case SDLK_KP4: mplayer_put_key(KEY_KP4); break; + case SDLK_KP5: mplayer_put_key(KEY_KP5); break; + case SDLK_KP6: mplayer_put_key(KEY_KP6); break; + case SDLK_KP7: mplayer_put_key(KEY_KP7); break; + case SDLK_KP8: mplayer_put_key(KEY_KP8); break; + case SDLK_KP9: mplayer_put_key(KEY_KP9); break; + case SDLK_KP_PERIOD: mplayer_put_key(KEY_KPDEC); break; + case SDLK_KP_ENTER: mplayer_put_key(KEY_KPENTER); break; default: //printf("got scancode: %d keysym: %d mod: %d %d\n", event.key.keysym.scancode, keypressed, event.key.keysym.mod); mplayer_put_key(keypressed);
--- a/libvo/wskeys.h Wed Apr 09 16:21:42 2003 +0000 +++ b/libvo/wskeys.h Wed Apr 09 17:05:39 2003 +0000 @@ -102,6 +102,28 @@ #define wsGrayMinus 0xad + 256 #define wsGrayMul 0xaa + 256 #define wsGrayDiv 0xaf + 256 +#define wsGrayDecimal 0xae + 256 +#define wsGray0 0xb0 + 256 +#define wsGray1 0xb1 + 256 +#define wsGray2 0xb2 + 256 +#define wsGray3 0xb3 + 256 +#define wsGray4 0xb4 + 256 +#define wsGray5 0xb5 + 256 +#define wsGray6 0xb6 + 256 +#define wsGray7 0xb7 + 256 +#define wsGray8 0xb8 + 256 +#define wsGray9 0xb9 + 256 +#define wsGrayHome 0x95 + 256 +#define wsGrayLeft 0x96 + 256 +#define wsGrayUp 0x97 + 256 +#define wsGrayRight 0x98 + 256 +#define wsGrayDown 0x99 + 256 +#define wsGrayPgUp 0x9a + 256 +#define wsGrayPgDn 0x9b + 256 +#define wsGrayEnd 0x9c + 256 +#define wsGray5Dup 0x9d + 256 +#define wsGrayInsert 0x9e + 256 +#define wsGrayDelete 0x9f + 256 #endif
--- a/libvo/x11_common.c Wed Apr 09 16:21:42 2003 +0000 +++ b/libvo/x11_common.c Wed Apr 09 17:05:39 2003 +0000 @@ -434,6 +434,16 @@ case wsEnd: mplayer_put_key(KEY_END); break; case wsPageUp: mplayer_put_key(KEY_PAGE_UP); break; case wsPageDown: mplayer_put_key(KEY_PAGE_DOWN); break; + case wsF1: mplayer_put_key(KEY_F+1); break; + case wsF2: mplayer_put_key(KEY_F+2); break; + case wsF3: mplayer_put_key(KEY_F+3); break; + case wsF4: mplayer_put_key(KEY_F+4); break; + case wsF5: mplayer_put_key(KEY_F+5); break; + case wsF6: mplayer_put_key(KEY_F+6); break; + case wsF7: mplayer_put_key(KEY_F+7); break; + case wsF8: mplayer_put_key(KEY_F+8); break; + case wsF9: mplayer_put_key(KEY_F+9); break; + case wsF10: mplayer_put_key(KEY_F+10); break; case wsq: case wsQ: mplayer_put_key('q'); break; case wsp: @@ -448,6 +458,29 @@ case wsDiv: mplayer_put_key('/'); break; case wsLess: mplayer_put_key('<'); break; case wsMore: mplayer_put_key('>'); break; + case wsGray0: mplayer_put_key(KEY_KP0); break; + case wsGrayEnd: + case wsGray1: mplayer_put_key(KEY_KP1); break; + case wsGrayDown: + case wsGray2: mplayer_put_key(KEY_KP2); break; + case wsGrayPgDn: + case wsGray3: mplayer_put_key(KEY_KP3); break; + case wsGrayLeft: + case wsGray4: mplayer_put_key(KEY_KP4); break; + case wsGray5Dup: + case wsGray5: mplayer_put_key(KEY_KP5); break; + case wsGrayRight: + case wsGray6: mplayer_put_key(KEY_KP6); break; + case wsGrayHome: + case wsGray7: mplayer_put_key(KEY_KP7); break; + case wsGrayUp: + case wsGray8: mplayer_put_key(KEY_KP8); break; + case wsGrayPgUp: + case wsGray9: mplayer_put_key(KEY_KP9); break; + case wsGrayDecimal: mplayer_put_key(KEY_KPDEC); break; + case wsGrayInsert: mplayer_put_key(KEY_KPINS); break; + case wsGrayDelete: mplayer_put_key(KEY_KPDEL); break; + case wsGrayEnter: mplayer_put_key(KEY_KPENTER); break; case wsm: case wsM: mplayer_put_key('m'); break; case wso:
--- a/osdep/keycodes.h Wed Apr 09 16:21:42 2003 +0000 +++ b/osdep/keycodes.h Wed Apr 09 17:05:39 2003 +0000 @@ -40,3 +40,20 @@ #define KEY_XF86_STOP (KEY_XF86_BASE+2) #define KEY_XF86_PREV (KEY_XF86_BASE+3) #define KEY_XF86_NEXT (KEY_XF86_BASE+4) + +/* Keypad keys */ +#define KEY_KEYPAD (KEY_BASE+32) +#define KEY_KP0 (KEY_KEYPAD+0) +#define KEY_KP1 (KEY_KEYPAD+1) +#define KEY_KP2 (KEY_KEYPAD+2) +#define KEY_KP3 (KEY_KEYPAD+3) +#define KEY_KP4 (KEY_KEYPAD+4) +#define KEY_KP5 (KEY_KEYPAD+5) +#define KEY_KP6 (KEY_KEYPAD+6) +#define KEY_KP7 (KEY_KEYPAD+7) +#define KEY_KP8 (KEY_KEYPAD+8) +#define KEY_KP9 (KEY_KEYPAD+9) +#define KEY_KPDEC (KEY_KEYPAD+10) +#define KEY_KPINS (KEY_KEYPAD+11) +#define KEY_KPDEL (KEY_KEYPAD+12) +#define KEY_KPENTER (KEY_KEYPAD+13)