From 693879649420c0997bfb29bea7f5752f6d9ac526 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 17 Apr 2012 11:31:47 +0300 Subject: Move keyboard handling from guichan to own classes. --- src/guichan/widgets/slider.cpp | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'src/guichan/widgets/slider.cpp') 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) -- cgit v1.2.3-60-g2f50