summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyEvent.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r--macosx/tkMacOSXKeyEvent.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index 3742399..0429cb2 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -49,6 +49,8 @@
* acting in its behalf permission to use and distribute the
* software in accordance with the terms specified in this
* license.
+ *
+ * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.6.2.4 2005/08/09 07:40:00 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -172,7 +174,9 @@ int TkMacOSXProcessKeyboardEvent(
* handler.
*/
- if (IsMenuKeyEvent(NULL, eventPtr->eventRef,
+ if ((eventPtr->eKind == kEventRawKeyDown
+ || eventPtr->eKind == kEventRawKeyRepeat)
+ && IsMenuKeyEvent(NULL, eventPtr->eventRef,
kMenuEventQueryOnly, &menuRef, &menuItemIndex)) {
MenuCommand menuCmd;
@@ -425,16 +429,19 @@ GenerateKeyEvent(
static int
InitKeyData(KeyEventData * keyEventDataPtr)
{
+ int x, y;
memset (keyEventDataPtr, 0, sizeof(*keyEventDataPtr));
- keyEventDataPtr->whichWindow = FrontNonFloatingWindow();
+ keyEventDataPtr->whichWindow = ActiveNonFloatingWindow();
if (keyEventDataPtr->whichWindow == NULL) {
return false;
}
- GetMouse(&keyEventDataPtr->local);
- keyEventDataPtr->global = keyEventDataPtr->local;
- LocalToGlobal(&keyEventDataPtr->global);
- keyEventDataPtr->state = TkMacOSXButtonKeyState();
+ XQueryPointer(NULL, None, NULL, NULL, &x, &y,
+ NULL, NULL, &keyEventDataPtr->state);
+ keyEventDataPtr->global.v = x;
+ keyEventDataPtr->global.v = y;
+ keyEventDataPtr->local = keyEventDataPtr->global;
+ GlobalToLocal(&keyEventDataPtr->local);
return true;
}