forked from len0rd/rockbox
Add support multimedia keys/buttons to the core, and adapt Rockbox on android for it (multimedia buttons are found on wired headsets and the lock screen in cyanogenmod).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28421 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dbe2ac1ec6
commit
49f1ec8e8a
13 changed files with 300 additions and 17 deletions
|
@ -45,3 +45,24 @@ int key_to_button(int keyboard_key)
|
|||
return BUTTON_MENU;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned multimedia_to_button(int keyboard_key)
|
||||
{
|
||||
switch (keyboard_key)
|
||||
{
|
||||
case KEYCODE_MEDIA_PLAY_PAUSE:
|
||||
return BUTTON_MULTIMEDIA_PLAYPAUSE;
|
||||
case KEYCODE_MEDIA_STOP:
|
||||
return BUTTON_MULTIMEDIA_STOP;
|
||||
case KEYCODE_MEDIA_NEXT:
|
||||
return BUTTON_MULTIMEDIA_NEXT;
|
||||
case KEYCODE_MEDIA_PREVIOUS:
|
||||
return BUTTON_MULTIMEDIA_PREV;
|
||||
case KEYCODE_MEDIA_REWIND:
|
||||
return BUTTON_MULTIMEDIA_REW;
|
||||
case KEYCODE_MEDIA_FAST_FORWARD:
|
||||
return BUTTON_MULTIMEDIA_FFWD;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue