1
0
Fork 0
forked from len0rd/rockbox

pressing u in the sim simulates usb. press u again to "disconnect"

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12437 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-02-21 14:32:41 +00:00
parent a4a30dd72e
commit e6bf827a75

View file

@ -65,7 +65,6 @@ void set_remote_backlight_filter_keypress(bool value)
} }
#endif #endif
#endif #endif
void button_event(int key, bool pressed) void button_event(int key, bool pressed)
{ {
int new_btn = 0; int new_btn = 0;
@ -82,10 +81,25 @@ void button_event(int key, bool pressed)
static bool skip_remote_release = false; static bool skip_remote_release = false;
#endif #endif
#endif #endif
static bool usb_connected = false;
if (usb_connected && key != SDLK_u)
return;
switch (key) switch (key)
{ {
case SDLK_u:
if (!pressed)
{
usb_connected = !usb_connected;
if (usb_connected)
btn = SYS_USB_CONNECTED;
else
btn = SYS_USB_DISCONNECTED;
queue_post(&button_queue, btn, 0);
return;
}
break;
#if CONFIG_KEYPAD == GIGABEAT_PAD #if CONFIG_KEYPAD == GIGABEAT_PAD
case SDLK_KP4: case SDLK_KP4:
case SDLK_LEFT: case SDLK_LEFT:
@ -689,4 +703,3 @@ bool remote_button_hold(void) {
return false; return false;
} }
#endif #endif