Improve the c100 keymap and button names.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21081 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cd5e98db08
commit
244afc0a0f
3 changed files with 88 additions and 128 deletions
|
@ -34,63 +34,54 @@
|
|||
* Insert LAST_ITEM_IN_LIST at the end of each mapping
|
||||
*/
|
||||
static const struct button_mapping button_context_standard[] = {
|
||||
{ ACTION_STD_PREV, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_STD_PREVREPEAT, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_NEXT, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXTREPEAT, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
|
||||
{ ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
|
||||
{ ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
|
||||
// { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
|
||||
{ ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_STD_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
|
||||
{ ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
|
||||
{ ACTION_STD_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_standard */
|
||||
|
||||
|
||||
static const struct button_mapping button_context_wps[] = {
|
||||
{ ACTION_WPS_PLAY, BUTTON_VOLUP|BUTTON_REL, BUTTON_VOLUP },
|
||||
{ ACTION_WPS_STOP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_VOLUP },
|
||||
|
||||
{ ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
|
||||
{ ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
|
||||
{ ACTION_WPS_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP },
|
||||
{ ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
|
||||
{ ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
|
||||
{ ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
|
||||
|
||||
{ ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
|
||||
{ ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
|
||||
{ ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
|
||||
{ ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL,BUTTON_RIGHT|BUTTON_REPEAT },
|
||||
|
||||
{ ACTION_WPS_ABSETB_NEXTDIR,BUTTON_MENU|BUTTON_RIGHT, BUTTON_MENU },
|
||||
{ ACTION_WPS_ABSETA_PREVDIR,BUTTON_MENU|BUTTON_LEFT, BUTTON_MENU },
|
||||
{ ACTION_WPS_ABRESET, BUTTON_MENU|BUTTON_VOLUP, BUTTON_MENU },
|
||||
{ ACTION_WPS_ABSETB_NEXTDIR,BUTTON_POWER|BUTTON_RIGHT, BUTTON_POWER },
|
||||
{ ACTION_WPS_ABSETA_PREVDIR,BUTTON_POWER|BUTTON_LEFT, BUTTON_POWER },
|
||||
{ ACTION_WPS_ABRESET, BUTTON_POWER|BUTTON_UP, BUTTON_POWER },
|
||||
|
||||
{ ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
|
||||
{ ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
|
||||
{ ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_VOLUP, BUTTON_SELECT },
|
||||
{ ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_VOLDOWN, BUTTON_SELECT },
|
||||
{ ACTION_WPS_CONTEXT, BUTTON_VOLDOWN|BUTTON_REL, BUTTON_VOLDOWN },
|
||||
{ ACTION_WPS_QUICKSCREEN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_VOLDOWN },
|
||||
{ ACTION_WPS_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
|
||||
{ ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
|
||||
{ ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_VOLUP, BUTTON_SELECT },
|
||||
{ ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_VOLDOWN, BUTTON_SELECT },
|
||||
{ ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
|
||||
{ ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_wps */
|
||||
|
||||
static const struct button_mapping button_context_settings[] = {
|
||||
{ ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_RESET, BUTTON_SELECT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_SETTINGS_INC, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_INCREPEAT,BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_SETTINGS_DEC, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DECREPEAT,BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_SETTINGS_INC, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_INCREPEAT,BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DEC, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DECREPEAT,BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
|
@ -99,19 +90,18 @@ static const struct button_mapping button_context_settings[] = {
|
|||
|
||||
static const struct button_mapping button_context_list[] = {
|
||||
#ifdef HAVE_VOLUME_IN_LIST
|
||||
{ ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
|
||||
{ ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_LIST_VOLUP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_LIST_VOLUP, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_LIST_VOLDOWN, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_LIST_VOLDOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
#endif
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
}; /* button_context_list */
|
||||
|
||||
static const struct button_mapping button_context_tree[] = {
|
||||
// { ACTION_TREE_WPS, BUTTON_REC|BUTTON_VOLUP, BUTTON_REC },
|
||||
// { ACTION_TREE_STOP, BUTTON_REC|BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_REC|BUTTON_VOLUP },
|
||||
{ ACTION_TREE_WPS, BUTTON_UP|BUTTON_REL, BUTTON_UP },
|
||||
{ ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
|
||||
}; /* button_context_tree */
|
||||
|
@ -122,7 +112,6 @@ static const struct button_mapping button_context_listtree_scroll_without_combo[
|
|||
{ ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
|
||||
{ ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
|
||||
|
||||
{ ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
|
||||
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
@ -150,18 +139,13 @@ static const struct button_mapping button_context_yesno[] = {
|
|||
}; /* button_context_settings_yesno */
|
||||
|
||||
static const struct button_mapping button_context_quickscreen[] = {
|
||||
{ ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
|
||||
|
||||
{ ACTION_QS_DOWNINV, BUTTON_VOLUP|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWNINV, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_QS_DOWN, BUTTON_VOLDOWN|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
|
@ -171,66 +155,42 @@ static const struct button_mapping button_context_quickscreen[] = {
|
|||
static const struct button_mapping button_context_settings_right_is_inc[] = {
|
||||
{ ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
|
||||
}; /* button_context_settings_right_is_inc */
|
||||
|
||||
static const struct button_mapping button_context_pitchscreen[] = {
|
||||
{ ACTION_PS_INC_SMALL, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_PS_INC_BIG, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_PS_DEC_SMALL, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_PS_DEC_BIG, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_PS_INC_SMALL, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_PS_INC_BIG, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_PS_DEC_SMALL, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_PS_DEC_BIG, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
|
||||
|
||||
{ ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
|
||||
|
||||
{ ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_PS_EXIT, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
|
||||
}; /* button_context_pitchscreen */
|
||||
|
||||
/** Recording Screen **/
|
||||
#ifdef HAVE_RECORDING
|
||||
static const struct button_mapping button_context_recscreen[] = {
|
||||
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
|
||||
{ ACTION_REC_PAUSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
|
||||
{ ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
|
||||
|
||||
{ ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
}; /* button_context_recscreen */
|
||||
#endif
|
||||
|
||||
/** FM Radio Screen **/
|
||||
#if CONFIG_TUNER
|
||||
static const struct button_mapping button_context_radio[] = {
|
||||
{ ACTION_NONE, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_FM_MENU, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_FM_PRESET, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_FM_STOP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_VOLUP },
|
||||
{ ACTION_FM_MODE, BUTTON_REC, BUTTON_NONE },
|
||||
{ ACTION_FM_EXIT, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
|
||||
{ ACTION_FM_PLAY, BUTTON_VOLUP|BUTTON_REL, BUTTON_VOLUP },
|
||||
{ ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_INCREPEAT,BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DECREPEAT,BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_FM_MENU, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_FM_PRESET, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_FM_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_FM_MODE, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
|
||||
{ ACTION_FM_EXIT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
|
||||
{ ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
|
||||
}; /* button_context_radio */
|
||||
#endif
|
||||
|
@ -246,19 +206,18 @@ static const struct button_mapping button_context_keyboard[] = {
|
|||
// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
|
||||
// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
|
||||
|
||||
{ ACTION_KBD_UP, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_KBD_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_KBD_DOWN, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_KBD_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_KBD_UP, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_KBD_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_KBD_DOWN, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_KBD_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN|BUTTON_REPEAT,BUTTON_NONE },
|
||||
|
||||
// { ACTION_KBD_PAGE_FLIP, BUTTON_REC|BUTTON_SELECT, BUTTON_REC },
|
||||
|
||||
{ ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
|
||||
{ ACTION_KBD_DONE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
|
||||
{ ACTION_KBD_ABORT, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_keyboard */
|
||||
|
@ -271,12 +230,12 @@ static const struct button_mapping button_context_bmark[] = {
|
|||
|
||||
#ifdef HAVE_USBSTACK
|
||||
static const struct button_mapping button_context_usb_hid[] = {
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_VOLUP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MUTE, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_MENU, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_PLAY, BUTTON_UP, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_STOP, BUTTON_POWER, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPPREV, BUTTON_LEFT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_SKIPNEXT, BUTTON_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MUTE, BUTTON_VOLDOWN, BUTTON_NONE },
|
||||
{ ACTION_USB_HID_MENU, BUTTON_DOWN, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* button_context_usb_hid */
|
||||
|
|
|
@ -31,30 +31,31 @@ void button_init_device(void)
|
|||
int button_read_device(void)
|
||||
{
|
||||
int btn = BUTTON_NONE;
|
||||
|
||||
if (!button_hold()){
|
||||
|
||||
if (!button_hold())
|
||||
{
|
||||
GPIOA |= 0x4;
|
||||
GPIOA &= ~0x8;
|
||||
|
||||
|
||||
int i=20; while (i--);
|
||||
|
||||
if (GPIOA & 0x10) btn |= BUTTON_PLAYPAUSE; /* up */
|
||||
|
||||
if (GPIOA & 0x10) btn |= BUTTON_UP;
|
||||
if (GPIOA & 0x20) btn |= BUTTON_RIGHT;
|
||||
if (GPIOA & 0x40) btn |= BUTTON_LEFT;
|
||||
|
||||
GPIOA |= 0x8;
|
||||
GPIOA &= ~0x4;
|
||||
|
||||
|
||||
i=20; while (i--);
|
||||
|
||||
|
||||
if (GPIOA & 0x10) btn |= BUTTON_VOLUP;
|
||||
if (GPIOA & 0x20) btn |= BUTTON_VOLDOWN;
|
||||
if (GPIOA & 0x40) btn |= BUTTON_REPEATAB; /* down */
|
||||
|
||||
if (GPIOA & 0x40) btn |= BUTTON_DOWN;
|
||||
|
||||
if (GPIOA & 0x80) btn |= BUTTON_SELECT;
|
||||
if (GPIOA & 0x100) btn |= BUTTON_MENU;
|
||||
if (GPIOA & 0x100) btn |= BUTTON_POWER;
|
||||
}
|
||||
return btn;
|
||||
return btn;
|
||||
}
|
||||
|
||||
bool button_hold(void)
|
||||
|
|
|
@ -32,23 +32,23 @@ int button_read_device(void);
|
|||
bool button_hold(void);
|
||||
|
||||
/* Main unit's buttons */
|
||||
#define BUTTON_MENU 0x00000001
|
||||
#define BUTTON_POWER 0x00000001
|
||||
#define BUTTON_VOLUP 0x00000002
|
||||
#define BUTTON_VOLDOWN 0x00000004
|
||||
#define BUTTON_PLAYPAUSE 0x00000008
|
||||
#define BUTTON_REPEATAB 0x00000010
|
||||
#define BUTTON_UP 0x00000008
|
||||
#define BUTTON_DOWN 0x00000010
|
||||
#define BUTTON_LEFT 0x00000020
|
||||
#define BUTTON_RIGHT 0x00000040
|
||||
#define BUTTON_SELECT 0x00000080
|
||||
|
||||
#define BUTTON_MAIN (BUTTON_MENU|BUTTON_VOLUP|BUTTON_VOLDOWN\
|
||||
|BUTTON_PLAYPAUSE|BUTTON_REPEATAB|BUTTON_LEFT\
|
||||
#define BUTTON_MAIN (BUTTON_POWER|BUTTON_VOLUP|BUTTON_VOLDOWN\
|
||||
|BUTTON_UP|BUTTON_DOWN|BUTTON_LEFT\
|
||||
|BUTTON_RIGHT|BUTTON_SELECT)
|
||||
|
||||
#define BUTTON_REMOTE 0
|
||||
|
||||
/* Software power-off */
|
||||
#define POWEROFF_BUTTON BUTTON_MENU
|
||||
#define POWEROFF_BUTTON BUTTON_POWER
|
||||
#define POWEROFF_COUNT 40
|
||||
|
||||
#endif /* _BUTTON_TARGET_H_ */
|
||||
|
|
Loading…
Reference in a new issue