diff options
author | Andre Heider | 2009-02-15 14:17:54 +0000 |
---|---|---|
committer | Andre Heider | 2009-02-15 14:17:54 +0000 |
commit | c3cd2b7f064ab34e668c4db58d6d7462841fa844 (patch) | |
tree | f7dbfcbf219fd71dec79688fe3e29bb2e3c52ec4 /backends/platform | |
parent | a99e3e3fa64eebe5b427edcc193ad01fb75cd222 (diff) | |
download | scummvm-rg350-c3cd2b7f064ab34e668c4db58d6d7462841fa844.tar.gz scummvm-rg350-c3cd2b7f064ab34e668c4db58d6d7462841fa844.tar.bz2 scummvm-rg350-c3cd2b7f064ab34e668c4db58d6d7462841fa844.zip |
allow keyboard hotplugging.
svn-id: r38242
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/wii/osystem_events.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp index 2a9da4e954..9bef3edc2d 100644 --- a/backends/platform/wii/osystem_events.cpp +++ b/backends/platform/wii/osystem_events.cpp @@ -122,7 +122,16 @@ static bool kbd_thread_running = false; static bool kbd_thread_quit = false; static void * kbd_thread_func(void *arg) { + u8 turns = 0; + while (!kbd_thread_quit) { + // scan for new attached keyboards every 3s + turns++; + if (turns % (3 * 100) == 0) { + KEYBOARD_ScanForKeyboard(); + turns = 0; + } + KEYBOARD_Scan(); usleep(1000 * 10); } @@ -154,7 +163,7 @@ void OSystem_Wii::initEvents() { WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR); WPAD_SetIdleTimeout(120); - if(KEYBOARD_Init() > 0) { + if(KEYBOARD_Init() >= 0) { kbd_thread_quit = false; kbd_stack = (u8 *) memalign(32, KBD_THREAD_STACKSIZE); |