Merge pull request #1640 from slevenbits/CPEvent-modifierFlags

Add +[CPEvent modifierFlags]
This commit is contained in:
Alexander Ljungberg committed 2012-08-02 14:36:17 +01:00
commit cbb710cde7
1 file changed
+16 -1
+16 -1
View File
@@ -33,7 +33,8 @@
var CPMainCibFile = @"CPMainCibFile",
CPMainCibFileHumanFriendly = @"Main cib file base name";
CPMainCibFileHumanFriendly = @"Main cib file base name",
CPEventModifierFlags = 0;
CPApp = nil;
@@ -575,6 +576,7 @@ CPRunContinuesResponse = -1002;
- (void)sendEvent:(CPEvent)anEvent
{
_currentEvent = anEvent;
CPEventModifierFlags = [anEvent modifierFlags];
#if PLATFORM(DOM)
var willPropagate = [[[anEvent window] platformWindow] _willPropagateCurrentDOMEvent];
@@ -1379,3 +1381,16 @@ var _CPAppBootstrapperActions = nil;
}
@end
@implementation CPEvent (CPApplicationModifierFlags)
/*!
Returns the currently pressed modifier flags.
*/
+ (unsigned)modifierFlags
{
return CPEventModifierFlags;
}
@end