FS#10552 - Cowon D2: pgup/pgdn on minus/plus buttons in text viewer

Author: Nemtsev Alexey

Changes that were not part of the original patch:

- Updated corresponding manual entry
- Added support for having both buttons and touchscreen mapping to the same action


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24896 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2010-02-24 21:38:15 +00:00
parent 83d589dad1
commit 04e3eb0c54
2 changed files with 26 additions and 8 deletions

View file

@ -292,6 +292,8 @@ PLUGIN_HEADER
#elif CONFIG_KEYPAD == COWON_D2_PAD
#define VIEWER_QUIT BUTTON_POWER
#define VIEWER_MENU BUTTON_MENU
#define VIEWER_PAGE_UP BUTTON_MINUS
#define VIEWER_PAGE_DOWN BUTTON_PLUS
#elif CONFIG_KEYPAD == IAUDIO67_PAD
#define VIEWER_QUIT BUTTON_POWER
@ -369,13 +371,19 @@ PLUGIN_HEADER
#endif
#ifdef HAVE_TOUCHSCREEN
#ifndef VIEWER_QUIT
#ifdef VIEWER_QUIT
#define VIEWER_QUIT2 BUTTON_TOPLEFT
#else
#define VIEWER_QUIT BUTTON_TOPLEFT
#endif
#ifndef VIEWER_PAGE_UP
#ifdef VIEWER_PAGE_UP
#define VIEWER_PAGE_UP2 BUTTON_TOPMIDDLE
#else
#define VIEWER_PAGE_UP BUTTON_TOPMIDDLE
#endif
#ifndef VIEWER_PAGE_DOWN
#ifdef VIEWER_PAGE_DOWN
#define VIEWER_PAGE_DOWN2 BUTTON_BOTTOMMIDDLE
#else
#define VIEWER_PAGE_DOWN BUTTON_BOTTOMMIDDLE
#endif
#ifndef VIEWER_SCREEN_LEFT
@ -384,7 +392,9 @@ PLUGIN_HEADER
#ifndef VIEWER_SCREEN_RIGHT
#define VIEWER_SCREEN_RIGHT BUTTON_MIDRIGHT
#endif
#ifndef VIEWER_MENU
#ifdef VIEWER_MENU
#define VIEWER_MENU2 BUTTON_TOPRIGHT
#else
#define VIEWER_MENU BUTTON_TOPRIGHT
#endif
#ifndef VIEWER_AUTOSCROLL
@ -1591,6 +1601,7 @@ enum plugin_status plugin_start(const void* file)
button = rb->button_get_w_tmo(HZ/10);
switch (button) {
case VIEWER_MENU:
case VIEWER_MENU2:
viewer_menu();
break;
@ -1603,7 +1614,9 @@ enum plugin_status plugin_start(const void* file)
break;
case VIEWER_PAGE_UP:
case VIEWER_PAGE_UP2:
case VIEWER_PAGE_UP | BUTTON_REPEAT:
case VIEWER_PAGE_UP2 | BUTTON_REPEAT:
if (prefs.scroll_mode == PAGE)
{
/* Page up */
@ -1621,7 +1634,9 @@ enum plugin_status plugin_start(const void* file)
break;
case VIEWER_PAGE_DOWN:
case VIEWER_PAGE_DOWN2:
case VIEWER_PAGE_DOWN | BUTTON_REPEAT:
case VIEWER_PAGE_DOWN2 | BUTTON_REPEAT:
if (prefs.scroll_mode == PAGE)
{
/* Page down */
@ -1708,6 +1723,7 @@ enum plugin_status plugin_start(const void* file)
case VIEWER_RC_QUIT:
#endif
case VIEWER_QUIT:
case VIEWER_QUIT2:
viewer_exit(NULL);
done = true;
break;

View file

@ -15,7 +15,7 @@ files without a \fname{.txt} extension by using \emph{Open with} from the
\opt{IRIVER_H10_PAD}{\ButtonScrollUp}
\opt{SANSA_C200_PAD}{\ButtonVolUp}
\opt{GIGABEAT_S_PAD}{\ButtonPrev}
\opt{COWON_D2_PAD}{\TouchTopMiddle}
\opt{COWON_D2_PAD}{\ButtonMinus{} / \TouchTopMiddle}
\opt{HAVEREMOTEKEYMAP}{& }
& Scroll{}-up\\
@ -26,7 +26,7 @@ files without a \fname{.txt} extension by using \emph{Open with} from the
\opt{IRIVER_H10_PAD}{\ButtonScrollDown}
\opt{SANSA_C200_PAD}{\ButtonVolDown}
\opt{GIGABEAT_S_PAD}{\ButtonNext}
\opt{COWON_D2_PAD}{\TouchBottomMiddle}
\opt{COWON_D2_PAD}{\ButtonPlus{} / \TouchBottomMiddle}
\opt{HAVEREMOTEKEYMAP}{& }
& Scroll{}-down\\
@ -95,11 +95,12 @@ files without a \fname{.txt} extension by using \emph{Open with} from the
\opt{RECORDER_PAD}{\ButtonFOne}
\opt{ONDIO_PAD}{Long \ButtonMenu}
\opt{PLAYER_PAD,IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
,MROBE100_PAD,COWOND_D2_PAD}{\ButtonMenu}
,MROBE100_PAD}{\ButtonMenu}
\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
\opt{IAUDIO_X5_PAD,SANSA_C200_PAD,SANSA_E200_PAD}{\ButtonSelect}
\opt{SANSA_FUZE_PAD}{Long \ButtonSelect}
\opt{IRIVER_H10_PAD}{\ButtonRew}
\opt{COWON_D2_PAD}{\ButtonMenu{} / \TouchTopRight}
\opt{HAVEREMOTEKEYMAP}{& }
& Enter menu\\
@ -107,9 +108,10 @@ files without a \fname{.txt} extension by using \emph{Open with} from the
\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
,MROBE100_PAD,COWON_D2_PAD}{\ButtonPower}
,MROBE100_PAD}{\ButtonPower}
\opt{SANSA_FUZE_PAD}{Long \ButtonHome}
\opt{GIGABEAT_S_PAD}{\ButtonBack}
\opt{COWON_D2_PAD}{\ButtonPower{} / \TouchTopLeft}
\opt{HAVEREMOTEKEYMAP}{&
\opt{IRIVER_RC_H100_PAD}{\ButtonRCStop}
}