]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/systemkeyboardinput.cpp
Rework how widget ownership works in Container
[libs/gltk.git] / source / systemkeyboardinput.cpp
index a99183231f08e66203e5d16112e9cfbacdecbe3c..3c4439856944f71becb1414a05c7541ef44f1995 100644 (file)
@@ -7,8 +7,7 @@ namespace GLtk {
 
 SystemKeyboardInput::SystemKeyboardInput(Root &r, Input::Keyboard &k):
        InputMethod(r),
-       keyboard(k),
-       modifier_state(0)
+       keyboard(k)
 {
        keyboard.signal_button_press.connect(sigc::mem_fun(this, &SystemKeyboardInput::key_press));
        keyboard.signal_button_release.connect(sigc::mem_fun(this, &SystemKeyboardInput::key_release));
@@ -36,7 +35,7 @@ bool SystemKeyboardInput::key_press(unsigned key)
        case Input::KEY_RIGHT: return root.navigate(NAV_RIGHT);
        case Input::KEY_UP: return root.navigate(NAV_UP);
        case Input::KEY_DOWN: return root.navigate(NAV_DOWN);
-       case Input::KEY_TAB: return root.navigate(NAV_NEXT);
+       case Input::KEY_TAB: return root.navigate((modifier_state&MOD_SHIFT) ? NAV_PREVIOUS : NAV_NEXT);
        case Input::KEY_SPACE: return root.navigate(NAV_ACTIVATE);
        case Input::KEY_ENTER: return root.navigate(NAV_ACCEPT);
        case Input::KEY_ESC: return root.navigate(NAV_CANCEL);