summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-04-25 09:43:59 +0300
committerUoti Urpala <uau@mplayer2.org>2011-05-02 00:43:31 +0300
commit23cb82907220d0c2724a0ec92bde437cbcd67d6a (patch)
tree1c1ea8667a2da5b6ddb5dd8e2f0c6f6558304ab5 /osdep
parent3e86228fad309b54869bf2a3314756933ba74e43 (diff)
downloadmpv-23cb82907220d0c2724a0ec92bde437cbcd67d6a.tar.bz2
mpv-23cb82907220d0c2724a0ec92bde437cbcd67d6a.tar.xz
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.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/getch2-os2.c2
-rw-r--r--osdep/getch2-win.c2
-rw-r--r--osdep/getch2.c2
-rw-r--r--osdep/keycodes.h103
4 files changed, 3 insertions, 106 deletions
diff --git a/osdep/getch2-os2.c b/osdep/getch2-os2.c
index 27ebfaa354..05e408ff45 100644
--- a/osdep/getch2-os2.c
+++ b/osdep/getch2-os2.c
@@ -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"
diff --git a/osdep/getch2-win.c b/osdep/getch2-win.c
index 7d0ab8b17d..0b4d2b0bae 100644
--- a/osdep/getch2-win.c
+++ b/osdep/getch2-win.c
@@ -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"
diff --git a/osdep/getch2.c b/osdep/getch2.c
index 3369838682..7ddcb3f378 100644
--- a/osdep/getch2.c
+++ b/osdep/getch2.c
@@ -58,7 +58,7 @@
#include <fcntl.h>
#include "mp_fifo.h"
-#include "keycodes.h"
+#include "input/keycodes.h"
#include "getch2.h"
#ifdef HAVE_TERMIOS
diff --git a/osdep/keycodes.h b/osdep/keycodes.h
deleted file mode 100644
index d197c8e3e9..0000000000
--- a/osdep/keycodes.h
+++ /dev/null
@@ -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 */