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/tabbedarea.cpp | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'src/guichan/widgets/tabbedarea.cpp') diff --git a/src/guichan/widgets/tabbedarea.cpp b/src/guichan/widgets/tabbedarea.cpp index 3e7178548..fb6619bed 100644 --- a/src/guichan/widgets/tabbedarea.cpp +++ b/src/guichan/widgets/tabbedarea.cpp @@ -298,35 +298,8 @@ namespace gcn adjustSize(); } - void TabbedArea::keyPressed(KeyEvent& keyEvent) + void TabbedArea::keyPressed(KeyEvent& keyEvent A_UNUSED) { - if (keyEvent.isConsumed() || !isFocused()) - return; - - if (keyEvent.getKey().getValue() == Key::LEFT) - { - int index = getSelectedTabIndex(); - index--; - - if (index < 0) - return; - else - setSelectedTab(mTabs[index].first); - - keyEvent.consume(); - } - else if (keyEvent.getKey().getValue() == Key::RIGHT) - { - int index = getSelectedTabIndex(); - index++; - - if (index >= static_cast(mTabs.size())) - return; - else - setSelectedTab(mTabs[index].first); - - keyEvent.consume(); - } } void TabbedArea::death(const Event& event) -- cgit v1.2.3-60-g2f50