From a893748d4ee7c289f72f1338d23335fa9e0e5f1e Mon Sep 17 00:00:00 2001 From: torsten Date: Tue, 8 Sep 2009 17:50:14 +0000 Subject: [PATCH] Tatsuhiro Nishioka: Handle number keys on Keypad properly on Mac OS X --- src/Main/FGEventHandler.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Main/FGEventHandler.cxx b/src/Main/FGEventHandler.cxx index e4d1d1043..d6be62054 100644 --- a/src/Main/FGEventHandler.cxx +++ b/src/Main/FGEventHandler.cxx @@ -271,9 +271,14 @@ void FGEventHandler::handleKey(const osgGA::GUIEventAdapter& ea, int& key, std::map::iterator numPadIter = numlockKeyMap.find(key); if (numPadIter != numlockKeyMap.end()) { +#ifdef __APPLE__ + // Num Lock is always true on Mac + key = numPadIter->second; +#else if (ea.getModKeyMask() & osgGA::GUIEventAdapter::MODKEY_NUM_LOCK) { key = numPadIter->second; } +#endif } modifiers = osgToFGModifiers(ea.getModKeyMask());