mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-15 16:12:28 -05:00
Redesigned the button handling. The code now uses symbolic function defines instead of checking for specific buttons. This makes it easier to add support for new devices with different button layouts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5091 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
17f54a40f1
commit
6c33c51a4c
36 changed files with 1049 additions and 1163 deletions
|
|
@ -181,14 +181,15 @@ int kbd_input(char* text, int buflen)
|
|||
case MENU_LINE_INPUT:
|
||||
switch (button_pressed)
|
||||
{
|
||||
case BUTTON_UP:
|
||||
case BUTTON_UP | BUTTON_REPEAT:
|
||||
case BUTTON_PLAY:
|
||||
case BUTTON_PLAY | BUTTON_REPEAT:
|
||||
if (cursor_pos<len)
|
||||
cursor_pos++;
|
||||
button_pressed=BUTTON_NONE;
|
||||
break;
|
||||
case BUTTON_DOWN:
|
||||
case BUTTON_DOWN | BUTTON_REPEAT:
|
||||
|
||||
case BUTTON_STOP:
|
||||
case BUTTON_STOP | BUTTON_REPEAT:
|
||||
if (cursor_pos>0)
|
||||
cursor_pos--;
|
||||
button_pressed=BUTTON_NONE;
|
||||
|
|
@ -199,13 +200,13 @@ int kbd_input(char* text, int buflen)
|
|||
case MENU_LINE_NEWCHARS:
|
||||
switch (button_pressed)
|
||||
{
|
||||
case BUTTON_UP:
|
||||
case BUTTON_UP | BUTTON_REPEAT:
|
||||
case BUTTON_PLAY:
|
||||
case BUTTON_PLAY | BUTTON_REPEAT:
|
||||
x=(x+1+linelen)%linelen;
|
||||
button_pressed=BUTTON_NONE;
|
||||
break;
|
||||
case BUTTON_DOWN:
|
||||
case BUTTON_DOWN | BUTTON_REPEAT:
|
||||
case BUTTON_STOP:
|
||||
case BUTTON_STOP | BUTTON_REPEAT:
|
||||
x=(x-1+linelen)%linelen;
|
||||
button_pressed=BUTTON_NONE;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue