Tatsuhiro Nishioka:
Handle number keys on Keypad properly on Mac OS X
This commit is contained in:
parent
7e07b57d92
commit
a893748d4e
1 changed files with 5 additions and 0 deletions
|
@ -271,9 +271,14 @@ void FGEventHandler::handleKey(const osgGA::GUIEventAdapter& ea, int& key,
|
||||||
std::map<int, int>::iterator numPadIter = numlockKeyMap.find(key);
|
std::map<int, int>::iterator numPadIter = numlockKeyMap.find(key);
|
||||||
|
|
||||||
if (numPadIter != numlockKeyMap.end()) {
|
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) {
|
if (ea.getModKeyMask() & osgGA::GUIEventAdapter::MODKEY_NUM_LOCK) {
|
||||||
key = numPadIter->second;
|
key = numPadIter->second;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
modifiers = osgToFGModifiers(ea.getModKeyMask());
|
modifiers = osgToFGModifiers(ea.getModKeyMask());
|
||||||
|
|
Loading…
Add table
Reference in a new issue