Index: apps/keymaps/keymap-cowond2.c =================================================================== --- apps/keymaps/keymap-cowond2.c (revision 23223) +++ apps/keymaps/keymap-cowond2.c (working copy) @@ -62,7 +62,10 @@ { ACTION_WPS_VOLUP, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, - + { ACTION_WPS_SKIPNEXT, BUTTON_HOLD_PLUS, BUTTON_NONE }, + { ACTION_WPS_SKIPPREV, BUTTON_HOLD_MINUS, BUTTON_NONE }, + { ACTION_WPS_PLAY, BUTTON_HOLD_MENU, BUTTON_NONE }, + LAST_ITEM_IN_LIST }; /* button_context_wps */ Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 23223) +++ apps/lang/english.lang (working copy) @@ -13075,3 +13075,59 @@ swcodec: "Release Time" + + id: LANG_HOLD_PM + desc: in the Rockbox Info screen + user: core + + *: "Use Plus\Minus as Next\Prev Track?" + + + *: "Use Plus\Minus as Next\Prev Track?" + + + *: "Use Plus\Minus as Next\Prev Track?" + + + + id: LANG_HOLD_MENU + desc: in the Rockbox Info screen + user: core + + *: "Use Menu as Play\Pause?" + + + *: "Use Menu as Play\Pause?" + + + *: "Use Menu as Play\Pause?" + + + + id: LANG_D2WPSHOLD + desc: in the Rockbox Info screen + user: core + + *: "Buttons in WPS" + + + *: "Buttons in WPS" + + + *: "Buttons in WPS" + + \ No newline at end of file Index: apps/lang/russian.lang =================================================================== --- apps/lang/russian.lang (revision 23223) +++ apps/lang/russian.lang (working copy) @@ -12370,3 +12370,59 @@ touchscreen: "Режим сенсороного экрана" + + id: LANG_HOLD_PM + desc: in the Rockbox Info screen + user: core + + *: "Use Plus\Minus as Next\Prev Track?" + + + *: "Использовать +\- при блокировке для переключения треков?" + + + *: "Использовать плюс и минус при блокировке для переключения треков?" + + + + id: LANG_HOLD_MENU + desc: in the Rockbox Info screen + user: core + + *: "Use Menu as Play\Pause?" + + + *: "Использовать MENU при блокировке для приостановки?" + + + *: "Использовать кнопку меню при блокировке для приостановки?" + + + + id: LANG_D2WPSHOLD + desc: in the Rockbox Info screen + user: core + + *: "Buttons in WPS" + + + *: "Настройки кнопок при блокировке" + + + *: "Настройки кнопок при блокировке" + + \ No newline at end of file Index: apps/menus/settings_menu.c =================================================================== --- apps/menus/settings_menu.c (revision 23223) +++ apps/menus/settings_menu.c (working copy) @@ -393,6 +393,15 @@ MENUITEM_FUNCTION(browse_langs, 0, ID2P(LANG_LANGUAGE), language_browse, NULL, NULL, Icon_Language); +/* HOLDCTRLS MENU */ +#ifdef COWON_D2 +MENUITEM_SETTING(holdwps_pmin, &global_settings.holdwps_pmin, NULL); +MENUITEM_SETTING(holdwps_menu, &global_settings.holdwps_menu, NULL); +MAKE_MENU(holdwps_menue, ID2P(LANG_D2WPSHOLD), 0, Icon_NOICON, + &holdwps_pmin, &holdwps_menu); +#endif +/* HOLDCTRLS MENU */ + MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, Icon_General_settings_menu, &playlist_settings, &file_menu, @@ -400,7 +409,10 @@ &tagcache_menu, #endif &display_menu, &system_menu, &bookmark_settings_menu, &browse_langs, &voice_settings_menu +#ifdef COWON_D2 + &holdwps_menue +#endif ); /* SETTINGS MENU */ /***********************************/ Index: apps/settings.h =================================================================== --- apps/settings.h (revision 23223) +++ apps/settings.h (working copy) @@ -791,6 +791,10 @@ int compressor_release_time; #endif +#ifdef COWON_D2 + bool holdwps_pmin; + bool holdwps_menu; +#endif }; /** global variables **/ Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (revision 23223) +++ apps/settings_list.c (working copy) @@ -1634,6 +1634,11 @@ #endif /* Customizable list */ +#ifdef COWON_D2 + OFFON_SETTING(0, holdwps_pmin, LANG_HOLD_PM, true,"use plusminus", NULL), + OFFON_SETTING(0, holdwps_menu, LANG_HOLD_MENU, true,"use menu", NULL), +#endif + #ifdef HAVE_LCD_BITMAP VIEWPORT_SETTING(ui_vp_config, "ui viewport"), #ifdef HAVE_REMOTE_LCD Index: firmware/target/arm/tcc780x/cowond2/button-cowond2.c =================================================================== --- firmware/target/arm/tcc780x/cowond2/button-cowond2.c (revision 23223) +++ firmware/target/arm/tcc780x/cowond2/button-cowond2.c (working copy) @@ -26,6 +26,8 @@ #include "backlight.h" #include "touchscreen-target.h" #include +#include "settings.h" + void button_init_device(void) { @@ -53,18 +55,16 @@ bool hold_button_old; *data = old_data; - + hold_button_old = hold_button; hold_button = button_hold(); + #ifndef BOOTLOADER if (hold_button != hold_button_old) backlight_hold_changed(hold_button); #endif - if (hold_button) - return BUTTON_NONE; - if (GPIOB & 0x4) { adc = adc_read(ADC_BUTTONS); @@ -86,7 +86,22 @@ btn |= BUTTON_MENU; } } - + /** ret buttons on hold **/ + if (button_hold() & global_settings.holdwps_pmin) + { + if (btn & BUTTON_MINUS) + return BUTTON_HOLD_MINUS; + else if (btn & BUTTON_PLUS) + return BUTTON_HOLD_PLUS; + else + return BUTTON_NONE; + } + if (button_hold() & global_settings.holdwps_menu) + { if (btn & BUTTON_MENU) + return BUTTON_HOLD_MENU; + else + return BUTTON_NONE; + } btn |= touchscreen_read_device(data, &old_data); if (!(GPIOA & 0x4)) Index: firmware/target/arm/tcc780x/cowond2/button-target.h =================================================================== --- firmware/target/arm/tcc780x/cowond2/button-target.h (revision 23223) +++ firmware/target/arm/tcc780x/cowond2/button-target.h (working copy) @@ -56,6 +56,11 @@ #define BUTTON_MAIN 0x1FFF +/* Button codes return when hold is enabled */ +#define BUTTON_HOLD_PLUS 0x00004000 +#define BUTTON_HOLD_MINUS 0x00008000 +#define BUTTON_HOLD_MENU 0x00010000 + /* No remote */ #define BUTTON_REMOTE 0 Index: utils/wpseditor/libwps/src/include/lang.h =================================================================== --- utils/wpseditor/libwps/src/include/lang.h (revision 23223) +++ utils/wpseditor/libwps/src/include/lang.h (working copy) @@ -27,5 +27,6 @@ #define VOICE_PAUSE (signed char)6 #define LANG_BATTERY_TIME (signed char)7 #define UNIT_PERCENT (signed char)8 +#define LANG_D2WPSHOLD (signed char)9 #define str(...) "empty"