diff options
author | das <das@noemail.net> | 2006-05-12 18:17:55 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2006-05-12 18:17:55 (GMT) |
commit | d059725fee85890f5c5f5b7edb5b09606a0d42ff (patch) | |
tree | fb99f4007bad0b04541adf13ecdd5cbe8e5b6204 /macosx/tkMacOSXKeyEvent.c | |
parent | cf092953889b04b2e5d94fc0a9e659114dcdc6b4 (diff) | |
download | tk-d059725fee85890f5c5f5b7edb5b09606a0d42ff.zip tk-d059725fee85890f5c5f5b7edb5b09606a0d42ff.tar.gz tk-d059725fee85890f5c5f5b7edb5b09606a0d42ff.tar.bz2 |
* generic/tkCanvWind.c (DisplayWinItem, WinItemRequestProc): ensure
canvas window items are unmapped when canvas is unmapped. [Bug 940117]
* macosx/tkMacOSXSubwindows.c (TkMacOSXUpdateClipRgn): empty clip region
of unmapped windows to prevent any drawing into them or into their
children from becoming visible. [Bug 940117]
* macosx/tkMacOSXInt.h: revert Jim's attempt of 2005-03-14 to
* macosx/tkMacOSXSubwindows.c: fix Bug 940117 as it disables Map/Unmap
event propagation to children. [Bug 1480105]
* macosx/tkMacOSXDraw.c (TkPutImage): handle tkPictureIsOpen flag, fixes
incorrect positioning of images with complex alpha on native buttons;
actual alpha blending is still broken in this situation. [Bug 1155596]
* macosx/tkMacOSXEvent.c (TkMacOSXProcessCommandEvent):
* macosx/tkMacOSXMenus.c (TkMacOSXInitMenus): workaround carbon bug with
key shortcut for 'Preferences' app menu item. [Bug 1481503]
* macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): only check
for HICommand menu item shortcuts in the application menu.
* macosx/tkMacOSXInt.h: initialize keyboard layout setup in
* macosx/tkMacOSXInit.c: TkpInit() rather than during handling of
* macosx/tkMacOSXKeyEvent.c: first key down event.
* macosx/tkMacOSXDraw.c: add optional debug code to flash clip
* macosx/tkMacOSXSubwindows.c: regions during update or draw.
FossilOrigin-Name: a75d23da37089f4892a8bcf58c4e6f5c37adabf9
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 75 |
1 files changed, 52 insertions, 23 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 020206c..1a37b75 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -4,7 +4,11 @@ * This file implements functions that decode & handle keyboard events * on MacOS X. * - * Copyright 2001, Apple Computer, Inc. + * Copyright 2001, Apple Computer, Inc. + * Copyright (c) 2006 Daniel A. Steffen <das@users.sourceforge.net> + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * The following terms apply to all files originating from Apple * Computer, Inc. ("Apple") and associated with the software @@ -50,7 +54,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.6.2.8 2006/04/28 06:02:59 das Exp $ + * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.6.2.9 2006/05/12 18:17:55 das Exp $ */ #include "tkMacOSXInt.h" @@ -173,24 +177,23 @@ TkMacOSXProcessKeyboardEvent( */ if ((eventPtr->eKind == kEventRawKeyDown - || eventPtr->eKind == kEventRawKeyRepeat) - && IsMenuKeyEvent(NULL, eventPtr->eventRef, - kMenuEventQueryOnly, &menuRef, &menuItemIndex)) { - MenuCommand menuCmd; - - GetMenuItemCommandID (menuRef, menuItemIndex, &menuCmd); - - switch (menuCmd) { - case kHICommandHide: - case kHICommandHideOthers: - case kHICommandShowAll: - case kHICommandPreferences: - statusPtr->stopProcessing = 0; - return 0; /* TODO: may not be on event on queue. */ - break; - default: - break; - } + || eventPtr->eKind == kEventRawKeyRepeat) + && IsMenuKeyEvent(tkAppleMenu, eventPtr->eventRef, + kMenuEventQueryOnly, &menuRef, &menuItemIndex)) { + MenuCommand menuCmd; + + GetMenuItemCommandID (menuRef, menuItemIndex, &menuCmd); + switch (menuCmd) { + case kHICommandHide: + case kHICommandHideOthers: + case kHICommandShowAll: + case kHICommandPreferences: + statusPtr->stopProcessing = 0; + return 0; /* TODO: may not be on event on queue. */ + break; + default: + break; + } } status = GetEventParameter(eventPtr->eventRef, @@ -1187,7 +1190,7 @@ XUngrabKeyboard( { gKeyboardWinPtr = NULL; } - + /* *---------------------------------------------------------------------- * @@ -1204,7 +1207,7 @@ TkMacOSXGetCapture() { return gGrabWinPtr; } - + /* *---------------------------------------------------------------------- * @@ -1233,7 +1236,7 @@ TkpSetCapture( } gGrabWinPtr = (Tk_Window) winPtr; } - + /* *---------------------------------------------------------------------- * @@ -1260,3 +1263,29 @@ Tk_SetCaretPos(tkwin, x, y, height) int height; { } + +/* + *---------------------------------------------------------------------- + * + * TkMacOSXInitKeyboard -- + * + * This procedure initializes the keyboard layout. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +MODULE_SCOPE void +TkMacOSXInitKeyboard ( + Tcl_Interp *interp) +{ + Ptr resource; + TextEncoding encoding; + + GetKeyboardLayout(&resource,&encoding); +} |