diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-21 14:32:41 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-21 14:32:41 +0000 |
commit | e6bf827a759e501207317293c8fdb103c4d709d4 (patch) | |
tree | aec54de2ef39577c3bbf93466903d370427b1407 /uisimulator/sdl | |
parent | a4a30dd72e38c2ec0e598fcfa76aaa44867965d9 (diff) |
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
Diffstat (limited to 'uisimulator/sdl')
-rw-r--r-- | uisimulator/sdl/button.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 6f274dd56d..7bc04409cf 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -65,7 +65,6 @@ void set_remote_backlight_filter_keypress(bool value) } #endif #endif - void button_event(int key, bool pressed) { int new_btn = 0; @@ -82,10 +81,25 @@ void button_event(int key, bool pressed) static bool skip_remote_release = false; #endif #endif - + static bool usb_connected = false; + if (usb_connected && key != SDLK_u) + return; 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 case SDLK_KP4: case SDLK_LEFT: @@ -689,4 +703,3 @@ bool remote_button_hold(void) { return false; } #endif - |