From 57b2d73632d04f22ea3d195ef8fce5cdd51f8b6f Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Wed, 30 Jan 2013 11:15:01 +0000 Subject: [PATCH] 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. --- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index ae91f7f5c..39af270ad 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -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],