diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-17 11:31:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-17 11:31:47 +0300 |
commit | 693879649420c0997bfb29bea7f5752f6d9ac526 (patch) | |
tree | 01d6c56532d561385edbfe2ad0235df6c5a58c5f /src/guichan/widgets/slider.cpp | |
parent | 8df35828d69f3debd89557a74c26359a8b249f87 (diff) | |
download | mv-693879649420c0997bfb29bea7f5752f6d9ac526.tar.gz mv-693879649420c0997bfb29bea7f5752f6d9ac526.tar.bz2 mv-693879649420c0997bfb29bea7f5752f6d9ac526.tar.xz mv-693879649420c0997bfb29bea7f5752f6d9ac526.zip |
Move keyboard handling from guichan to own classes.
Diffstat (limited to 'src/guichan/widgets/slider.cpp')
-rw-r--r-- | src/guichan/widgets/slider.cpp | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/src/guichan/widgets/slider.cpp b/src/guichan/widgets/slider.cpp index 36f067eab..d7e8084cc 100644 --- a/src/guichan/widgets/slider.cpp +++ b/src/guichan/widgets/slider.cpp @@ -191,40 +191,8 @@ namespace gcn mMarkerLength = length; } - void Slider::keyPressed(KeyEvent& keyEvent) + void Slider::keyPressed(KeyEvent& keyEvent A_UNUSED) { - Key key = keyEvent.getKey(); - - if (getOrientation() == HORIZONTAL) - { - if (key.getValue() == Key::RIGHT) - { - setValue(getValue() + getStepLength()); - distributeActionEvent(); - keyEvent.consume(); - } - else if (key.getValue() == Key::LEFT) - { - setValue(getValue() - getStepLength()); - distributeActionEvent(); - keyEvent.consume(); - } - } - else - { - if (key.getValue() == Key::UP) - { - setValue(getValue() + getStepLength()); - distributeActionEvent(); - keyEvent.consume(); - } - else if (key.getValue() == Key::DOWN) - { - setValue(getValue() - getStepLength()); - distributeActionEvent(); - keyEvent.consume(); - } - } } void Slider::setOrientation(Slider::Orientation orientation) |