diff options
author | Stijn Buys <ingar@osirion.org> | 2008-09-03 19:43:31 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-09-03 19:43:31 +0000 |
commit | 033bd59cfc2dff93529ad448459ad6348ea29c8d (patch) | |
tree | c7311c4473bce2ec4e391c41427157d42f12c433 /src | |
parent | e56e8566789c5fcb5073bd5064c2edfa2b81f848 (diff) |
only one key repeat per frame
Diffstat (limited to 'src')
-rw-r--r-- | src/client/input.cc | 7 | ||||
-rw-r--r-- | src/client/keyboard.cc | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index 75fa0f3..5cbb17c 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -786,11 +786,8 @@ void frame(float seconds) for (Keyboard::iterator it = keyboard->begin(); it != keyboard->end(); it++) { key = (*it).second; if (key && key->pressed()) { - while ((key->pressed()+delay < core::application()->time()) && (key->lastpressed()+repeat < core::application()->time())) { - if (key->lastpressed() > key->pressed()) - key->key_lastpressed += repeat; - else - key->key_lastpressed += delay; + if ((key->pressed()+delay < core::application()->time()) && (key->lastpressed()+repeat < core::application()->time())) { + key->key_lastpressed = core::application()->time(); key_pressed(key); } } diff --git a/src/client/keyboard.cc b/src/client/keyboard.cc index ae21eb1..b420fb8 100644 --- a/src/client/keyboard.cc +++ b/src/client/keyboard.cc @@ -112,7 +112,7 @@ Keyboard::Keyboard() add_key("b", SDLK_b, 'b'); add_key("c", SDLK_c, 'c'); add_key("d", SDLK_d, 'd', "+straferight"); - add_key("e", SDLK_e, 'e'); + add_key("e", SDLK_e, 'e', "+rollright"); add_key("f", SDLK_f, 'f'); add_key("g", SDLK_g, 'g'); add_key("h", SDLK_h, 'h'); @@ -123,9 +123,10 @@ Keyboard::Keyboard() add_key("m", SDLK_m, 'm'); key = add_key("n", SDLK_n, 'n', "target_next"); key->assign(Key::Shift, "target_prev"); + key->assign(Key::Ctrl, "target_none"); add_key("o", SDLK_o, 'o'); add_key("p", SDLK_p, 'p'); - add_key("q", SDLK_q, 'q'); + add_key("q", SDLK_q, 'q', "+rollleft"); add_key("r", SDLK_r, 'r'); add_key("s", SDLK_s, 's', "+reverse"); add_key("t", SDLK_t, 't', "ui_chat"); |