diff options
author | ben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-05-18 11:53:00 +0000 |
---|---|---|
committer | ben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-05-18 11:53:00 +0000 |
commit | dc6d14fb1b20e86cc24c6fbe5ce239566e5d588e (patch) | |
tree | 0577b8baadd2986746a75e36642b543e0d6212fc /input/input.c | |
parent | 971b1a83d8751fdeb6640afa705eb9a39375f286 (diff) | |
download | mpv-dc6d14fb1b20e86cc24c6fbe5ce239566e5d588e.tar.bz2 mpv-dc6d14fb1b20e86cc24c6fbe5ce239566e5d588e.tar.xz |
Add support for AppleIR Remote as an input under Linux systems.
This requires Linux 2.6 with evdev and appleir drivers.
The keymapping is done to mimics the one that was done for MacOSX.
WARNING: Most distributions do not seems to bother and only let root
access to the device. Modify udev rules accordingly if you want regular
user to be able to use the remote.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26795 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'input/input.c')
-rw-r--r-- | input/input.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c index c43afbfa4f..da879cc6a7 100644 --- a/input/input.c +++ b/input/input.c @@ -569,6 +569,7 @@ static char* config_file = "input.conf"; static int use_ar = 1; static char* js_dev = NULL; +static char* ar_dev = NULL; static char* in_file = NULL; static int in_file_fd = -1; @@ -579,6 +580,7 @@ static int mp_input_print_cmd_list(m_option_t* cfg); // Our command line options static m_option_t input_conf[] = { { "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL }, + { "ar-dev", &ar_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL }, { "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL }, { "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL }, { "keylist", mp_input_print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL }, @@ -1760,6 +1762,16 @@ mp_input_init(int use_gui) { } #endif +#ifdef HAVE_APPLE_IR + if(use_ar) { + int fd = mp_input_appleir_init(ar_dev); + if(fd < 0) + mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantInitAppleRemote); + else + mp_input_add_key_fd(fd,1,mp_input_appleir_read,(mp_close_func_t)close); + } +#endif + if(in_file) { struct stat st; if(stat(in_file,&st)) |