=== modified file 'plugins/input/keyboard/keyboard.cpp' --- plugins/input/keyboard/keyboard.cpp 2007-07-25 05:29:22 +0000 +++ plugins/input/keyboard/keyboard.cpp 2007-07-30 23:08:28 +0000 @@ -36,7 +36,7 @@ "" ,"F1" ,"F2" ,"F3" ,"F4" ,"F5" ,"F6" ,"F7" ,"F8","F9","F10","F11","F12","F13","F14","F15"}; Keyboard::Keyboard() - : halfdelay_time(100), tty_mode(0) + : halfdelay_time(100), tty_mode(0), this_time(0), next_time(0) {} Keyboard::~Keyboard() @@ -89,6 +89,8 @@ { InputMaster *input_master = S_InputMaster::get_instance(); + struct timeval tv; + while (true) { S_Global::get_instance()->stop_bit_input_check(input); @@ -110,6 +112,17 @@ } // SDL_WasInit(...) #endif + gettimeofday(&tv,NULL); + this_time = (unsigned long long) tv.tv_sec*1000+tv.tv_usec/1000; + if (next_time > this_time) + goto nogood; + else { + int delay = 200; + if (input_from_device == "ESC" || input_from_device == "F5") + delay = 1500; + next_time = (unsigned long long) tv.tv_sec*1000+tv.tv_usec/1000 + delay; + } + if (accept_all) { Input i; === modified file 'plugins/input/keyboard/keyboard.hpp' --- plugins/input/keyboard/keyboard.hpp 2007-07-28 21:49:55 +0000 +++ plugins/input/keyboard/keyboard.hpp 2007-07-30 23:09:58 +0000 @@ -31,6 +31,9 @@ struct termios orig_tty; struct termios new_tty; + unsigned long long next_time; + unsigned long long this_time; + #ifdef use_sdl std::string getSDLkey(); #endif === modified file 'plugins/output/sdl/sdlout.cpp' --- plugins/output/sdl/sdlout.cpp 2007-07-31 22:48:36 +0000 +++ plugins/output/sdl/sdlout.cpp 2007-07-30 22:27:52 +0000 @@ -321,6 +321,10 @@ input_key = string_format::convert(kbuf); locked_mutex.leaveMutex(); return true; + } else if (event.type == SDL_BUTTON_LEFT || event.type == SDL_BUTTON_RIGHT || event.type == SDL_MOUSEMOTION) { + input_key = "F5"; + locked_mutex.leaveMutex(); + return true; } locked_mutex.leaveMutex(); } else {