input: move all key code lists to input/keycodes.h

Move the definitions of all special key codes (those not passed by
ASCII value) to input/keycodes.h. Before they were spread between
osdep/keycodes.h, input/joystick.h, input/mouse.h and input/ar.h, plus
some special values in input.h. This was especially inconvenient as
the codes had to be coordinated to not conflict between the files.

The change requires a bit of ugliness as appleir.c includes
<linux/input.h> which contains various conflicting KEY_* definitions.
Work around this by adding a special preprocessor variable which can
be used to avoid defining these in keycodes.h.
This commit is contained in:
Uoti Urpala 2011-04-25 09:43:59 +03:00
parent 3e86228fad
commit 23cb829072
32 changed files with 225 additions and 242 deletions

View File

@ -39,6 +39,10 @@
#include "mp_msg.h"
// keycodes.h defines would conflict with linux/input.h ones
#define AR_DEFINES_ONLY
#include "keycodes.h"
#define EVDEV_MAX_EVENTS 32
/* ripped from AppleIR driver */

View File

@ -31,6 +31,7 @@
#include "input.h"
#include "ar.h"
#include "keycodes.h"
extern int slave_mode;

View File

@ -23,18 +23,6 @@
#ifndef MPLAYER_AR_H
#define MPLAYER_AR_H
#define AR_BASE 0x500
#define AR_PLAY (AR_BASE + 0)
#define AR_PLAY_HOLD (AR_BASE + 1)
#define AR_NEXT (AR_BASE + 2)
#define AR_NEXT_HOLD (AR_BASE + 3)
#define AR_PREV (AR_BASE + 4)
#define AR_PREV_HOLD (AR_BASE + 5)
#define AR_MENU (AR_BASE + 6)
#define AR_MENU_HOLD (AR_BASE + 7)
#define AR_VUP (AR_BASE + 8)
#define AR_VDOWN (AR_BASE + 9)
/* MacOSX Driver */
int mp_input_ar_init(void);
int mp_input_ar_read(void *ctx, int fd);

View File

@ -31,12 +31,11 @@
#include <ctype.h>
#include "input.h"
#include "mouse.h"
#ifdef MP_DEBUG
#include <assert.h>
#endif
#include "mp_fifo.h"
#include "osdep/keycodes.h"
#include "keycodes.h"
#include "osdep/timer.h"
#include "libavutil/avstring.h"
#include "mp_msg.h"

View File

@ -182,13 +182,6 @@ typedef enum {
//! Input will be available if you try again
#define MP_INPUT_RETRY -4
// For the key's drivers, if possible you can send key up and key down
// events. Key up is the default, to send a key down you must use the
// OR operator between the key code and MP_KEY_DOWN.
#define MP_KEY_DOWN (1<<29)
// Use this when the key shouldn't be auto-repeated (like mouse buttons)
#define MP_NO_REPEAT_KEY (1<<28)
#ifndef MP_MAX_KEY_DOWN
#define MP_MAX_KEY_DOWN 32
#endif

View File

@ -19,40 +19,6 @@
#ifndef MPLAYER_JOYSTICK_H
#define MPLAYER_JOYSTICK_H
#define JOY_BASE (0x100+128)
#define JOY_AXIS0_PLUS (JOY_BASE+0)
#define JOY_AXIS0_MINUS (JOY_BASE+1)
#define JOY_AXIS1_PLUS (JOY_BASE+2)
#define JOY_AXIS1_MINUS (JOY_BASE+3)
#define JOY_AXIS2_PLUS (JOY_BASE+4)
#define JOY_AXIS2_MINUS (JOY_BASE+5)
#define JOY_AXIS3_PLUS (JOY_BASE+6)
#define JOY_AXIS3_MINUS (JOY_BASE+7)
#define JOY_AXIS4_PLUS (JOY_BASE+8)
#define JOY_AXIS4_MINUS (JOY_BASE+9)
#define JOY_AXIS5_PLUS (JOY_BASE+10)
#define JOY_AXIS5_MINUS (JOY_BASE+11)
#define JOY_AXIS6_PLUS (JOY_BASE+12)
#define JOY_AXIS6_MINUS (JOY_BASE+13)
#define JOY_AXIS7_PLUS (JOY_BASE+14)
#define JOY_AXIS7_MINUS (JOY_BASE+15)
#define JOY_AXIS8_PLUS (JOY_BASE+16)
#define JOY_AXIS8_MINUS (JOY_BASE+17)
#define JOY_AXIS9_PLUS (JOY_BASE+18)
#define JOY_AXIS9_MINUS (JOY_BASE+19)
#define JOY_BTN_BASE ((0x100+148)|MP_NO_REPEAT_KEY)
#define JOY_BTN0 (JOY_BTN_BASE+0)
#define JOY_BTN1 (JOY_BTN_BASE+1)
#define JOY_BTN2 (JOY_BTN_BASE+2)
#define JOY_BTN3 (JOY_BTN_BASE+3)
#define JOY_BTN4 (JOY_BTN_BASE+4)
#define JOY_BTN5 (JOY_BTN_BASE+5)
#define JOY_BTN6 (JOY_BTN_BASE+6)
#define JOY_BTN7 (JOY_BTN_BASE+7)
#define JOY_BTN8 (JOY_BTN_BASE+8)
#define JOY_BTN9 (JOY_BTN_BASE+9)
int mp_input_joystick_init(char* dev);
int mp_input_joystick_read(void *ctx, int fd);

194
input/keycodes.h Normal file
View File

@ -0,0 +1,194 @@
/*
* KEY code definitions for keys/events not passed by ASCII value
*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_KEYCODES_H
#define MPLAYER_KEYCODES_H
// For appleir.c which includes another header with KEY_ENTER etc defines
#ifndef AR_DEFINES_ONLY
#define KEY_ENTER 13
#define KEY_TAB 9
#define KEY_BASE 0x100
/* Function keys */
#define KEY_F (KEY_BASE+64)
/* Control keys */
#define KEY_CTRL (KEY_BASE)
#define KEY_BACKSPACE (KEY_CTRL+0)
#define KEY_DELETE (KEY_CTRL+1)
#define KEY_INSERT (KEY_CTRL+2)
#define KEY_HOME (KEY_CTRL+3)
#define KEY_END (KEY_CTRL+4)
#define KEY_PAGE_UP (KEY_CTRL+5)
#define KEY_PAGE_DOWN (KEY_CTRL+6)
#define KEY_ESC (KEY_CTRL+7)
/* Control keys short name */
#define KEY_BS KEY_BACKSPACE
#define KEY_DEL KEY_DELETE
#define KEY_INS KEY_INSERT
#define KEY_PGUP KEY_PAGE_UP
#define KEY_PGDOWN KEY_PAGE_DOWN
#define KEY_PGDWN KEY_PAGE_DOWN
/* Cursor movement */
#define KEY_CRSR (KEY_BASE+16)
#define KEY_RIGHT (KEY_CRSR+0)
#define KEY_LEFT (KEY_CRSR+1)
#define KEY_DOWN (KEY_CRSR+2)
#define KEY_UP (KEY_CRSR+3)
/* 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)
#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)
// Joystick input module
#define JOY_BASE (0x100+128)
#define JOY_AXIS0_PLUS (JOY_BASE+0)
#define JOY_AXIS0_MINUS (JOY_BASE+1)
#define JOY_AXIS1_PLUS (JOY_BASE+2)
#define JOY_AXIS1_MINUS (JOY_BASE+3)
#define JOY_AXIS2_PLUS (JOY_BASE+4)
#define JOY_AXIS2_MINUS (JOY_BASE+5)
#define JOY_AXIS3_PLUS (JOY_BASE+6)
#define JOY_AXIS3_MINUS (JOY_BASE+7)
#define JOY_AXIS4_PLUS (JOY_BASE+8)
#define JOY_AXIS4_MINUS (JOY_BASE+9)
#define JOY_AXIS5_PLUS (JOY_BASE+10)
#define JOY_AXIS5_MINUS (JOY_BASE+11)
#define JOY_AXIS6_PLUS (JOY_BASE+12)
#define JOY_AXIS6_MINUS (JOY_BASE+13)
#define JOY_AXIS7_PLUS (JOY_BASE+14)
#define JOY_AXIS7_MINUS (JOY_BASE+15)
#define JOY_AXIS8_PLUS (JOY_BASE+16)
#define JOY_AXIS8_MINUS (JOY_BASE+17)
#define JOY_AXIS9_PLUS (JOY_BASE+18)
#define JOY_AXIS9_MINUS (JOY_BASE+19)
#define JOY_BTN_BASE ((0x100+148)|MP_NO_REPEAT_KEY)
#define JOY_BTN0 (JOY_BTN_BASE+0)
#define JOY_BTN1 (JOY_BTN_BASE+1)
#define JOY_BTN2 (JOY_BTN_BASE+2)
#define JOY_BTN3 (JOY_BTN_BASE+3)
#define JOY_BTN4 (JOY_BTN_BASE+4)
#define JOY_BTN5 (JOY_BTN_BASE+5)
#define JOY_BTN6 (JOY_BTN_BASE+6)
#define JOY_BTN7 (JOY_BTN_BASE+7)
#define JOY_BTN8 (JOY_BTN_BASE+8)
#define JOY_BTN9 (JOY_BTN_BASE+9)
// Mouse events from VOs
#define MOUSE_BASE ((0x100+256)|MP_NO_REPEAT_KEY)
#define MOUSE_BTN0 (MOUSE_BASE+0)
#define MOUSE_BTN1 (MOUSE_BASE+1)
#define MOUSE_BTN2 (MOUSE_BASE+2)
#define MOUSE_BTN3 (MOUSE_BASE+3)
#define MOUSE_BTN4 (MOUSE_BASE+4)
#define MOUSE_BTN5 (MOUSE_BASE+5)
#define MOUSE_BTN6 (MOUSE_BASE+6)
#define MOUSE_BTN7 (MOUSE_BASE+7)
#define MOUSE_BTN8 (MOUSE_BASE+8)
#define MOUSE_BTN9 (MOUSE_BASE+9)
#define MOUSE_BTN_END (MOUSE_BASE+10)
#define MOUSE_BASE_DBL (0x300|MP_NO_REPEAT_KEY)
#define MOUSE_BTN0_DBL (MOUSE_BASE_DBL+0)
#define MOUSE_BTN1_DBL (MOUSE_BASE_DBL+1)
#define MOUSE_BTN2_DBL (MOUSE_BASE_DBL+2)
#define MOUSE_BTN3_DBL (MOUSE_BASE_DBL+3)
#define MOUSE_BTN4_DBL (MOUSE_BASE_DBL+4)
#define MOUSE_BTN5_DBL (MOUSE_BASE_DBL+5)
#define MOUSE_BTN6_DBL (MOUSE_BASE_DBL+6)
#define MOUSE_BTN7_DBL (MOUSE_BASE_DBL+7)
#define MOUSE_BTN8_DBL (MOUSE_BASE_DBL+8)
#define MOUSE_BTN9_DBL (MOUSE_BASE_DBL+9)
#define MOUSE_BTN_DBL_END (MOUSE_BASE_DBL+10)
#endif // AR_DEFINES_ONLY
// Apple Remote input module
#define AR_BASE 0x500
#define AR_PLAY (AR_BASE + 0)
#define AR_PLAY_HOLD (AR_BASE + 1)
#define AR_NEXT (AR_BASE + 2)
#define AR_NEXT_HOLD (AR_BASE + 3)
#define AR_PREV (AR_BASE + 4)
#define AR_PREV_HOLD (AR_BASE + 5)
#define AR_MENU (AR_BASE + 6)
#define AR_MENU_HOLD (AR_BASE + 7)
#define AR_VUP (AR_BASE + 8)
#define AR_VDOWN (AR_BASE + 9)
#ifndef AR_DEFINES_ONLY
/* Special keys */
#define KEY_INTERN (0x1000)
#define KEY_CLOSE_WIN (KEY_INTERN+0)
/* Modifiers added to individual keys */
#define KEY_MODIFIER_SHIFT 0x2000
#define KEY_MODIFIER_CTRL 0x4000
#define KEY_MODIFIER_ALT 0x8000
#define KEY_MODIFIER_META 0x10000
#endif // AR_DEFINES_ONLY
// Use this when the key shouldn't be auto-repeated (like mouse buttons)
#define MP_NO_REPEAT_KEY (1<<28)
#define MP_KEY_DOWN (1<<29)
#endif /* MPLAYER_KEYCODES_H */

View File

@ -1,46 +0,0 @@
/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_MOUSE_H
#define MPLAYER_MOUSE_H
#define MOUSE_BASE ((0x100+256)|MP_NO_REPEAT_KEY)
#define MOUSE_BTN0 (MOUSE_BASE+0)
#define MOUSE_BTN1 (MOUSE_BASE+1)
#define MOUSE_BTN2 (MOUSE_BASE+2)
#define MOUSE_BTN3 (MOUSE_BASE+3)
#define MOUSE_BTN4 (MOUSE_BASE+4)
#define MOUSE_BTN5 (MOUSE_BASE+5)
#define MOUSE_BTN6 (MOUSE_BASE+6)
#define MOUSE_BTN7 (MOUSE_BASE+7)
#define MOUSE_BTN8 (MOUSE_BASE+8)
#define MOUSE_BTN9 (MOUSE_BASE+9)
#define MOUSE_BASE_DBL (0x300|MP_NO_REPEAT_KEY)
#define MOUSE_BTN0_DBL (MOUSE_BASE_DBL+0)
#define MOUSE_BTN1_DBL (MOUSE_BASE_DBL+1)
#define MOUSE_BTN2_DBL (MOUSE_BASE_DBL+2)
#define MOUSE_BTN3_DBL (MOUSE_BASE_DBL+3)
#define MOUSE_BTN4_DBL (MOUSE_BASE_DBL+4)
#define MOUSE_BTN5_DBL (MOUSE_BASE_DBL+5)
#define MOUSE_BTN6_DBL (MOUSE_BASE_DBL+6)
#define MOUSE_BTN7_DBL (MOUSE_BASE_DBL+7)
#define MOUSE_BTN8_DBL (MOUSE_BASE_DBL+8)
#define MOUSE_BTN9_DBL (MOUSE_BASE_DBL+9)
#endif /* MPLAYER_MOUSE_H */

View File

@ -28,7 +28,7 @@
#include "libvo/osd.h"
#include "sub/font_load.h"
#include "sub/sub.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "asxparser.h"
#include "stream/stream.h"
#include "input/input.h"

View File

@ -39,7 +39,7 @@
#include "menu.h"
#include "sub/font_load.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "input/input.h"
#include "osdep/timer.h"

View File

@ -39,7 +39,7 @@
#include "menu.h"
#include "menu_list.h"
#include "input/input.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "stream/dvbin.h"

View File

@ -41,7 +41,7 @@
#include "menu.h"
#include "menu_list.h"
#include "input/input.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#define MENU_KEEP_PATH "/tmp/mp_current_path"

View File

@ -30,7 +30,7 @@
#include "menu.h"
#include "sub/font_load.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#define IMPL 1
#include "menu_list.h"

View File

@ -31,7 +31,7 @@
#include "menu.h"
#include "sub/font_load.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
struct menu_priv_s {
char** lines;

View File

@ -23,7 +23,7 @@
#include "osx_common.h"
#include "old_vo_defines.h"
#include "video_out.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "input/input.h"
/*

View File

@ -22,9 +22,8 @@
#include "old_vo_defines.h"
#include "mp_msg.h"
#include "mp_fifo.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "input/input.h"
#include "input/mouse.h"
#include "video_out.h"
static int old_w;

View File

@ -42,7 +42,7 @@
#include "sub/font_load.h"
#include "sub/sub.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include <aalib.h>
#include "subopt-helper.h"
#include "mp_msg.h"

View File

@ -37,7 +37,7 @@
#include "video_out_internal.h"
#include "sub/sub.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "mp_msg.h"
#include "mp_fifo.h"

View File

@ -44,9 +44,7 @@
#include "subopt-helper.h"
#include "input/input.h"
#include "input/mouse.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "osx_common.h"
//Cocoa

View File

@ -35,6 +35,7 @@
#include "mp_msg.h"
#include "aspect.h"
#include "mp_fifo.h"
#include "input/keycodes.h"
static const vo_info_t info = {
"DirectFB / Matrox G200/G400/G450/G550",
@ -1435,8 +1436,6 @@ control( uint32_t request, void *data)
return VO_NOTIMPL;
}
#include "osdep/keycodes.h"
static void
check_events( void )
{

View File

@ -38,6 +38,7 @@
#include "aspect.h"
#include "subopt-helper.h"
#include "mp_fifo.h"
#include "input/keycodes.h"
// triple buffering
#define TRIPLE 1
@ -848,8 +849,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
return 0;
}
#include "osdep/keycodes.h"
static void check_events(void)
{

View File

@ -31,8 +31,7 @@
#include "video_out_internal.h"
#include "fastmemcpy.h"
#include "input/input.h"
#include "osdep/keycodes.h"
#include "input/mouse.h"
#include "input/keycodes.h"
#include "mp_msg.h"
#include "aspect.h"
#include "geometry.h"

View File

@ -42,6 +42,7 @@
#include "video_out_internal.h"
#include "mp_fifo.h"
#include "input/keycodes.h"
#include <ggi/ggi.h>
@ -486,9 +487,6 @@ static int control(uint32_t request, void *data)
return VO_NOTIMPL;
}
/* EVENT handling */
#include "osdep/keycodes.h"
static void check_events(void)
{
struct timeval tv = {0, 0};

View File

@ -43,9 +43,8 @@
#include "fastmemcpy.h"
#include "mp_fifo.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "input/input.h"
#include "input/mouse.h"
#include "subopt-helper.h"
#include "sub/sub.h"

View File

@ -51,7 +51,7 @@
#include "sub/sub.h"
#include "input/input.h"
#include "input/mouse.h"
#include "input/keycodes.h"
#include "osx_common.h"
@ -141,8 +141,6 @@ enum
kPanScanCmd = 10
};
#include "osdep/keycodes.h"
//PROTOTYPE/////////////////////////////////////////////////////////////////
static OSStatus KeyEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
static OSStatus MouseEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);

View File

@ -23,9 +23,8 @@
// To get "#define vo_ontop global_vo->opts->vo_ontop" etc
#include "old_vo_defines.h"
#include "osdep/keycodes.h"
#include "input/keycodes.h"
#include "input/input.h"
#include "input/mouse.h"
#include "mp_msg.h"
#include "video_out.h"
#include "aspect.h"

View File

@ -74,7 +74,7 @@
#endif
#include "input/input.h"
#include "input/mouse.h"
#include "input/keycodes.h"
#define WIN_LAYER_ONBOTTOM 2
#define WIN_LAYER_NORMAL 4
@ -528,7 +528,6 @@ void vo_uninit(struct vo_x11_state *x11)
talloc_free(x11);
}
#include "osdep/keycodes.h"
#include "wskeys.h"
#ifdef XF86XK_AudioPause

View File

@ -19,7 +19,7 @@
#include <stdlib.h>
#include "osdep/timer.h"
#include "input/input.h"
#include "input/mouse.h"
#include "input/keycodes.h"
#include "mp_fifo.h"
#include "talloc.h"
#include "options.h"
@ -70,7 +70,7 @@ int mplayer_get_key(void *ctx, int fd)
static void put_double(struct mp_fifo *fifo, int code)
{
if (code >= MOUSE_BTN0 && code <= MOUSE_BTN9)
if (code >= MOUSE_BTN0 && code < MOUSE_BTN_END)
mplayer_put_key_internal(fifo, code - MOUSE_BTN0 + MOUSE_BTN0_DBL);
}
@ -81,7 +81,7 @@ void mplayer_put_key(struct mp_fifo *fifo, int code)
// ignore system-doubleclick if we generate these events ourselves
if (doubleclick_time
&& (code & ~MP_KEY_DOWN) >= MOUSE_BTN0_DBL
&& (code & ~MP_KEY_DOWN) <= MOUSE_BTN9_DBL)
&& (code & ~MP_KEY_DOWN) < MOUSE_BTN_DBL_END)
return;
mplayer_put_key_internal(fifo, code);
if (code & MP_KEY_DOWN) {

View File

@ -29,7 +29,7 @@
#include <string.h>
#include "config.h"
#include "keycodes.h"
#include "input/keycodes.h"
#include "input/input.h"
#include "mp_fifo.h"
#include "getch2.h"

View File

@ -28,7 +28,7 @@
#include <stdint.h>
#include <string.h>
#include <windows.h>
#include "keycodes.h"
#include "input/keycodes.h"
#include "input/input.h"
#include "mp_fifo.h"
#include "getch2.h"

View File

@ -58,7 +58,7 @@
#include <fcntl.h>
#include "mp_fifo.h"
#include "keycodes.h"
#include "input/keycodes.h"
#include "getch2.h"
#ifdef HAVE_TERMIOS

View File

@ -1,103 +0,0 @@
/*
* KEY code definitions for GyS-TermIO v2.0
*
* copyright (C) 1999 A'rpi/ESP-team
*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_KEYCODES_H
#define MPLAYER_KEYCODES_H
#define KEY_ENTER 13
#define KEY_TAB 9
#define KEY_BASE 0x100
/* Function keys */
#define KEY_F (KEY_BASE+64)
/* Control keys */
#define KEY_CTRL (KEY_BASE)
#define KEY_BACKSPACE (KEY_CTRL+0)
#define KEY_DELETE (KEY_CTRL+1)
#define KEY_INSERT (KEY_CTRL+2)
#define KEY_HOME (KEY_CTRL+3)
#define KEY_END (KEY_CTRL+4)
#define KEY_PAGE_UP (KEY_CTRL+5)
#define KEY_PAGE_DOWN (KEY_CTRL+6)
#define KEY_ESC (KEY_CTRL+7)
/* Control keys short name */
#define KEY_BS KEY_BACKSPACE
#define KEY_DEL KEY_DELETE
#define KEY_INS KEY_INSERT
#define KEY_PGUP KEY_PAGE_UP
#define KEY_PGDOWN KEY_PAGE_DOWN
#define KEY_PGDWN KEY_PAGE_DOWN
/* Cursor movement */
#define KEY_CRSR (KEY_BASE+16)
#define KEY_RIGHT (KEY_CRSR+0)
#define KEY_LEFT (KEY_CRSR+1)
#define KEY_DOWN (KEY_CRSR+2)
#define KEY_UP (KEY_CRSR+3)
/* 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)
#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)
/* Special keys */
#define KEY_INTERN (0x1000)
#define KEY_CLOSE_WIN (KEY_INTERN+0)
/* Modifiers added to individual keys */
#define KEY_MODIFIER_SHIFT 0x2000
#define KEY_MODIFIER_CTRL 0x4000
#define KEY_MODIFIER_ALT 0x8000
#define KEY_MODIFIER_META 0x10000
#endif /* MPLAYER_KEYCODES_H */