diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-26 15:48:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-26 15:48:37 +0300 |
commit | 93012ff28bfeae7820941e80a9a8568051790473 (patch) | |
tree | e673f6fcf768959f9a44933ddffac125724e77a6 /src/client.cpp | |
parent | a5d6ded17d979404d5b6e18573f35c99abaf97fb (diff) | |
download | plus-93012ff28bfeae7820941e80a9a8568051790473.tar.gz plus-93012ff28bfeae7820941e80a9a8568051790473.tar.bz2 plus-93012ff28bfeae7820941e80a9a8568051790473.tar.xz plus-93012ff28bfeae7820941e80a9a8568051790473.zip |
Add keyboard repeat setting to misc tab.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/client.cpp b/src/client.cpp index c871b2372..fe890c984 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -378,7 +378,7 @@ void Client::gameInit() initPacketLimiter(); SDL_EnableUNICODE(1); - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + applyKeyRepeat(); // disable unused SDL events SDL_EventState(SDL_VIDEOEXPOSE, SDL_IGNORE); @@ -687,6 +687,8 @@ void Client::gameInit() config.addListener("gamma", this); config.addListener("particleEmitterSkip", this); config.addListener("vsync", this); + config.addListener("repeateDelay", this); + config.addListener("repeateInterval", this); setGuiAlpha(config.getFloatValue("guialpha")); optionChanged("fpslimit"); @@ -1568,6 +1570,10 @@ void Client::optionChanged(const std::string &name) { applyVSync(); } + else if (name == "repeateInterval" or name == "repeateDelay") + { + applyKeyRepeat(); + } } void Client::action(const gcn::ActionEvent &event) @@ -2531,3 +2537,9 @@ void Client::applyVSync() if (val > 0 && val < 2) SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, val); } + +void Client::applyKeyRepeat() +{ + SDL_EnableKeyRepeat(config.getIntValue("repeateDelay"), + config.getIntValue("repeateInterval")); +} |