Index: apps/action.h =================================================================== --- apps/action.h (revision 25047) +++ apps/action.h (working copy) @@ -106,6 +106,7 @@ ACTION_STD_QUICKSCREEN, ACTION_STD_KEYLOCK, ACTION_STD_REC, + ACTION_STD_HOTKEY, ACTION_F3, /* just so everything works again, possibly change me */ /* code context actions */ @@ -196,7 +197,6 @@ ACTION_SETTINGS_RESET, /* bookmark screen */ - ACTION_BMS_DELETE, /* quickscreen */ ACTION_QS_LEFT, Index: apps/tree.c =================================================================== --- apps/tree.c (revision 25047) +++ apps/tree.c (working copy) @@ -756,13 +756,18 @@ break; #endif + case ACTION_STD_HOTKEY: +#ifndef HOTKEY + break; +#endif case ACTION_STD_CONTEXT: { + bool hotkey = button == ACTION_STD_HOTKEY; int onplay_result; int attr = 0; if(!numentries) - onplay_result = onplay(NULL, 0, curr_context); + onplay_result = onplay(NULL, 0, curr_context, hotkey); else { #ifdef HAVE_TAGCACHE if (id3db) @@ -788,7 +793,7 @@ snprintf(buf, sizeof buf, "/%s", dircache[tc.selected_item].name); } - onplay_result = onplay(buf, attr, curr_context); + onplay_result = onplay(buf, attr, curr_context, hotkey); } switch (onplay_result) { Index: apps/onplay.c =================================================================== --- apps/onplay.c (revision 25047) +++ apps/onplay.c (working copy) @@ -1174,19 +1174,30 @@ return ACTION_STD_CANCEL; } break; +#ifdef HOTKEY + case ACTION_STD_CONTEXT: + debugf("Hotkey Set\n"); + splash(HZ, "Hotkey Set"); + return ACTION_STD_CANCEL; +#endif case ACTION_EXIT_MENUITEM: return ACTION_EXIT_AFTER_THIS_MENUITEM; - break; } return action; } -int onplay(char* file, int attr, int from) +int onplay(char* file, int attr, int from, bool hotkey) { const struct menu_item_ex *menu; onplay_result = ONPLAY_OK; context = from; selected_file = file; selected_file_attr = attr; + if (hotkey) + { + debugf("Hotkey!\n"); + splash(HZ, "Hotkey!"); + return ONPLAY_RELOAD_DIR; + } if (context == CONTEXT_WPS) menu = &wps_onplay_menu; else Index: apps/gui/wps.c =================================================================== --- apps/gui/wps.c (revision 25047) +++ apps/gui/wps.c (working copy) @@ -887,11 +887,17 @@ #endif switch(button) { + case ACTION_STD_HOTKEY: +#ifndef HOTKEY + update = true; + break; +#endif case ACTION_WPS_CONTEXT: { gwps_leave_wps(); int retval = onplay(wps_state.id3->path, - FILE_ATTR_AUDIO, CONTEXT_WPS); + FILE_ATTR_AUDIO, CONTEXT_WPS, + button == ACTION_STD_HOTKEY); /* if music is stopped in the context menu we want to exit the wps */ if (retval == ONPLAY_MAINMENU || !audio_status()) Index: apps/onplay.h =================================================================== --- apps/onplay.h (revision 25047) +++ apps/onplay.h (working copy) @@ -21,7 +21,7 @@ #ifndef _ONPLAY_H_ #define _ONPLAY_H_ -int onplay(char* file, int attr, int from_screen); +int onplay(char* file, int attr, int from_screen, bool hotkey); enum { ONPLAY_MAINMENU = -1, Index: apps/bookmark.c =================================================================== --- apps/bookmark.c (revision 25047) +++ apps/bookmark.c (working copy) @@ -728,7 +728,7 @@ ID2P(LANG_BOOKMARK_CONTEXT_DELETE)); static const int menu_actions[] = { - ACTION_STD_OK, ACTION_BMS_DELETE + ACTION_STD_OK, ACTION_STD_HOTKEY }; int selection = do_menu(&menu_items, NULL, NULL, false); @@ -757,7 +757,7 @@ exit = true; break; - case ACTION_BMS_DELETE: + case ACTION_STD_HOTKEY: if (item >= 0) { const char *lines[]={ Index: apps/keymaps/keymap-e200.c =================================================================== --- apps/keymaps/keymap-e200.c (revision 25047) +++ apps/keymaps/keymap-e200.c (working copy) @@ -48,6 +48,7 @@ { ACTION_STD_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, + { ACTION_STD_HOTKEY, BUTTON_REC|BUTTON_REL, BUTTON_REC }, LAST_ITEM_IN_LIST }; /* button_context_standard */ @@ -272,12 +273,6 @@ LAST_ITEM_IN_LIST }; /* button_context_keyboard */ -static const struct button_mapping button_context_bmark[] = { - { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), -}; /* button_context_bmark */ - #ifdef USB_ENABLE_HID static const struct button_mapping button_context_usb_hid[] = { { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_REC|BUTTON_REL, BUTTON_REC }, @@ -418,7 +413,7 @@ case CONTEXT_FM: return button_context_radio; case CONTEXT_BOOKMARKSCREEN: - return button_context_bmark; + return button_context_list; case CONTEXT_QUICKSCREEN: return button_context_quickscreen; case CONTEXT_PITCHSCREEN: Index: apps/playlist_catalog.c =================================================================== --- apps/playlist_catalog.c (revision 25047) +++ apps/playlist_catalog.c (working copy) @@ -273,6 +273,10 @@ exit = true; break; + case ACTION_STD_HOTKEY: +#ifndef HOTKEY + break; +#endif case ACTION_STD_CONTEXT: /* context menu only available in view mode */ if (view) @@ -280,8 +284,8 @@ snprintf(playlist, MAX_PATH, "%s/%s", playlist_dir, sel_file); - if (onplay(playlist, FILE_ATTR_M3U, - CONTEXT_TREE) != ONPLAY_OK) + if (onplay(playlist, FILE_ATTR_M3U, CONTEXT_TREE, + button == ACTION_STD_HOTKEY) != ONPLAY_OK) { result = 0; exit = true; Index: firmware/export/config/sansae200.h =================================================================== --- firmware/export/config/sansae200.h (revision 25047) +++ firmware/export/config/sansae200.h (working copy) @@ -214,3 +214,5 @@ #define IRAMORIG 0x40004000 #endif +/* Define this if a programmable hotkey is available */ +#define HOTKEY