OS X updates; post-frame handler event

This commit is contained in:
Jack Andersen
2015-12-20 14:40:52 -10:00
parent 886ae22e08
commit 01ab873e06
4 changed files with 37 additions and 9 deletions

View File

@@ -729,7 +729,8 @@ enum
};
static boo::ESpecialKey translateKeycode(short code)
{
switch (code) {
switch (code)
{
case kVK_F1:
return boo::ESpecialKey::F1;
case kVK_F2:
@@ -787,14 +788,13 @@ static boo::ESpecialKey translateKeycode(short code)
{
if (!booContext->m_callback)
return;
boo::ESpecialKey special = translateKeycode(theEvent.keyCode);
NSString* chars = theEvent.characters;
if ([chars length] == 0 ||
[chars characterAtIndex:0] == '\n' ||
[chars characterAtIndex:0] == '\r')
booContext->m_callback->specialKeyDown(translateKeycode(theEvent.keyCode),
if (special != boo::ESpecialKey::None)
booContext->m_callback->specialKeyDown(special,
getMod(theEvent.modifierFlags),
theEvent.isARepeat);
else
else if ([chars length])
booContext->m_callback->charKeyDown([chars characterAtIndex:0],
getMod(theEvent.modifierFlags),
theEvent.isARepeat);
@@ -804,11 +804,12 @@ static boo::ESpecialKey translateKeycode(short code)
{
if (!booContext->m_callback)
return;
boo::ESpecialKey special = translateKeycode(theEvent.keyCode);
NSString* chars = theEvent.characters;
if ([chars length] == 0)
booContext->m_callback->specialKeyUp(translateKeycode(theEvent.keyCode),
if (special != boo::ESpecialKey::None)
booContext->m_callback->specialKeyUp(special,
getMod(theEvent.modifierFlags));
else
else if ([chars length])
booContext->m_callback->charKeyUp([chars characterAtIndex:0],
getMod(theEvent.modifierFlags));
}
@@ -1074,6 +1075,9 @@ public:
case EMouseCursor::VerticalArrow:
[[NSCursor resizeUpDownCursor] set];
break;
case EMouseCursor::IBeam:
[[NSCursor IBeamCursor] set];
break;
default: break;
}
});