From e21d51c4bb2500a97bbb24f501b9ac94c1f80ee1 Mon Sep 17 00:00:00 2001 From: frohlich Date: Fri, 25 May 2007 18:08:37 +0000 Subject: [PATCH] Modified Files: src/Main/FGManipulator.cxx: Tim Moore: This adds support for the keypad and the ever-important backspace and delete (!) to the osgViewer code. --- src/Main/FGManipulator.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Main/FGManipulator.cxx b/src/Main/FGManipulator.cxx index 44c3dcae0..a5078fb59 100644 --- a/src/Main/FGManipulator.cxx +++ b/src/Main/FGManipulator.cxx @@ -152,6 +152,8 @@ void FGManipulator::handleKey(const osgGA::GUIEventAdapter& ea, int& key, switch (key) { case osgGA::GUIEventAdapter::KEY_Escape: key = 0x1b; break; case osgGA::GUIEventAdapter::KEY_Return: key = '\n'; break; + case osgGA::GUIEventAdapter::KEY_BackSpace: key = '\b'; break; + case osgGA::GUIEventAdapter::KEY_Delete: key = 0x7f; break; case osgGA::GUIEventAdapter::KEY_Left: key = PU_KEY_LEFT; break; case osgGA::GUIEventAdapter::KEY_Up: key = PU_KEY_UP; break; case osgGA::GUIEventAdapter::KEY_Right: key = PU_KEY_RIGHT; break; @@ -173,6 +175,17 @@ void FGManipulator::handleKey(const osgGA::GUIEventAdapter& ea, int& key, case osgGA::GUIEventAdapter::KEY_F10: key = PU_KEY_F10; break; case osgGA::GUIEventAdapter::KEY_F11: key = PU_KEY_F11; break; case osgGA::GUIEventAdapter::KEY_F12: key = PU_KEY_F12; break; + case osgGA::GUIEventAdapter::KEY_KP_0: key = 364; break; + case osgGA::GUIEventAdapter::KEY_KP_1: key = 363; break; + case osgGA::GUIEventAdapter::KEY_KP_2: key = 359; break; + case osgGA::GUIEventAdapter::KEY_KP_3: key = 361; break; + case osgGA::GUIEventAdapter::KEY_KP_4: key = 356; break; + case osgGA::GUIEventAdapter::KEY_KP_5: key = 309; break; + case osgGA::GUIEventAdapter::KEY_KP_6: key = 358; break; + case osgGA::GUIEventAdapter::KEY_KP_7: key = 362; break; + case osgGA::GUIEventAdapter::KEY_KP_8: key = 357; break; + case osgGA::GUIEventAdapter::KEY_KP_9: key = 360; break; + case osgGA::GUIEventAdapter::KEY_KP_Enter: key = 269; break; } modifiers = osgToFGModifiers(ea.getModKeyMask()); currentModifiers = modifiers;