[mythtv-commits] Ticket #2017: (mac osx port) apple remote support
MythTV
mythtv at cvs.mythtv.org
Fri Nov 9 13:42:44 UTC 2007
#2017: (mac osx port) apple remote support
------------------------------------+---------------------------------------
Reporter: mythtv at junk.kraney.com | Owner: nigel
Type: enhancement | Status: reopened
Priority: minor | Milestone: 0.20
Component: mythtv | Version: head
Severity: medium | Resolution:
Mlocked: 0 |
------------------------------------+---------------------------------------
Comment(by Myth):
FYI, the mplayer svn code works with apple remote in Leopard. The
relevant code snippet (including remote codes for both Tiger and Leopard)
is as follows (hopefully it is ok to cut and paste it here):
{{{
typedef struct cookie_keycode_map {
char *cookies;
int seq_len;
int keycode;
} cookie_keycode_map_t;
/* On tiger, 5 always follows 6; on leopard, 18 always follows 19.
* On leopard, there seems to be no cookie value of 5 or 6.
* Following is the shortened cookie sequence list
* keycode cookies_on_tiger cookies_on_leopard *down_state
* AR_PREV_HOLD 14+6+3+2 31+19+3+2 yes
* AR_NEXT_HOLD 14+6+4+2 31+19+4+2 yes
* AR_MENU_HOLD 14+6+14+6 31+19+31+19
* AR_VUP 14+12+11+6 31+29+28+19 yes
* AR_VDOWN 14+13+11+6 31+30+28+19 yes
* AR_MENU 14+7+6+14+7+6 31+20+19+31+20+19
* AR_PLAY 14+8+6+14+8+6 31+21+19+31+21+19
* AR_NEXT 14+9+6+14+9+6 31+22+19+31+22+19
* AR_PREV 14+10+6+14+10+6 31+23+19+31+23+19
* AR_PLAY_HOLD 18+14+6+18+14+6 35+31+19+35+31+19
*
* *down_state: A button with this feature has a pressed event and
* a released event, with which we can trace the state of the button.
* A button without this feature will only return one release event.
*
* hidden keys currently not implemented:
* hold for 5 secs
* MENU_NEXT_HOLD 15+14+6+15+14+6
* MENU_PREV_HOLD 16+14+6+16+14+6
* MENU_VUP_HOLD 20+14+6+20+14+6
* MENU_VDOWN_HOLD 19+14+6+19+14+6
*
* It seems that pressing 'menu' and 'play' on the Apple Remote for
* 5 seconds will trigger the make-pair function of the remote.
* MENU_PLAY_HOLD 21+15+14+6+15+14+6
*/
static const cookie_keycode_map_t ar_codes_tiger[] = {
{ "\x0E\x06\x03\x02", 4, AR_PREV_HOLD },
{ "\x0E\x06\x04\x02", 4, AR_NEXT_HOLD },
{ "\x0E\x06\x0E\x06", 4, AR_MENU_HOLD },
{ "\x0E\x0C\x0B\x06", 4, AR_VUP },
{ "\x0E\x0D\x0B\x06", 4, AR_VDOWN },
{ "\x0E\x07\x06\x0E\x07\x06", 6, AR_MENU },
{ "\x0E\x08\x06\x0E\x08\x06", 6, AR_PLAY },
{ "\x0E\x09\x06\x0E\x09\x06", 6, AR_NEXT },
{ "\x0E\x0A\x06\x0E\x0A\x06", 6, AR_PREV },
{ "\x12\x0E\x06\x12\x0E\x06", 6, AR_PLAY_HOLD },
{ NULL, 0, MP_INPUT_NOTHING },
};
static const cookie_keycode_map_t ar_codes_leopard[] = {
{ "\x1F\x13\x03\x02", 4, AR_PREV_HOLD },
{ "\x1F\x13\x04\x02", 4, AR_NEXT_HOLD },
{ "\x1F\x13\x1F\x13", 4, AR_MENU_HOLD },
{ "\x1F\x1D\x1C\x13", 4, AR_VUP },
{ "\x1F\x1E\x1C\x13", 4, AR_VDOWN },
{ "\x1F\x14\x13\x1F\x14\x13", 6, AR_MENU },
{ "\x1F\x15\x13\x1F\x15\x13", 6, AR_PLAY },
{ "\x1F\x16\x13\x1F\x16\x13", 6, AR_NEXT },
{ "\x1F\x17\x13\x1F\x17\x13", 6, AR_PREV },
{ "\x23\x1F\x13\x23\x1F\x13", 6, AR_PLAY_HOLD },
{ NULL, 0, MP_INPUT_NOTHING },
};
}}}
Current version of the code is
[http://svn.mplayerhq.hu/mplayer/trunk/input/ar.c?view=markup here].
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/2017#comment:21>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list