Fixed: undefined location of key events.

Without this fix all regular key events such as `CPKeyDown` would have an undefined location.

Since the location can't be retrieved from the browser on key events, this fix now makes it so that the last seen mouse position is included with each key event.
This commit is contained in:
Alexander Ljungberg
2013-01-30 11:15:01 +00:00
parent e4ff2fe476
commit 57b2d73632
+1 -1
View File
@@ -218,7 +218,6 @@ var resizeTimer = nil;
_windowLevels = [];
_windowLayers = [CPDictionary dictionary];
[self registerDOMWindow];
[self updateFromNativeContentRect];
@@ -677,6 +676,7 @@ var resizeTimer = nil;
- (void)keyEvent:(DOMEvent)aDOMEvent
{
var event,
location = _lastMouseEventLocation || _CGPointMakeZero(),
timestamp = [CPEvent currentTimestamp],
sourceElement = aDOMEvent.target || aDOMEvent.srcElement,
windowNumber = [[CPApp keyWindow] windowNumber],