summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyboard.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-09-09 23:52:02 (GMT)
committerhobbs <hobbs>2002-09-09 23:52:02 (GMT)
commit958042034bbbe215fbb0915cf6c07b9914923724 (patch)
tree804bf93151524b4ec43b4495c97883b3f0b0d9d8 /macosx/tkMacOSXKeyboard.c
parentec6a4daee7df6a5652185b52f34a9e48d28a652e (diff)
downloadtk-958042034bbbe215fbb0915cf6c07b9914923724.zip
tk-958042034bbbe215fbb0915cf6c07b9914923724.tar.gz
tk-958042034bbbe215fbb0915cf6c07b9914923724.tar.bz2
* library/tk.tcl: use command instead of control on Aqua bindings.
Force dialogs to appear below fixed native Mac menubar. * macosx/tkMacOSXKeyEvent.c: * macosx/tkMacOSXKeyboard.c: Keypress/release events for pure modifier keys were not being passed to Tk. Deadkey presses were inserting null characters into text windows. Now they do nothing. (Still not ideal, but better than before!) * macosx/tkMacOSXMenu.c: Allow more than 200 menus to exist - increased to 2000. * macosx/tkMacOSXMouseEvent.c: Bad interactions between floating windows and ordinary ones. Ensure that local<->global coordinate transformations are wrt to the correct window. * macosx/tkMacOSXWm.c: Better error msg for 'wm attributes'. Remove crash in 'wm transient'. Add 'noActivates' and 'noUpdates' flags to unsupported command. [Patch #606658] (darley)
Diffstat (limited to 'macosx/tkMacOSXKeyboard.c')
-rw-r--r--macosx/tkMacOSXKeyboard.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index db5d679..aff807e 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXKeyboard.c,v 1.2 2002/08/31 06:12:30 das Exp $
+ * RCS: @(#) $Id: tkMacOSXKeyboard.c,v 1.3 2002/09/09 23:52:02 hobbs Exp $
*/
#include "tkInt.h"
@@ -148,6 +148,14 @@ XKeycodeToKeysym(
if (!initialized) {
InitKeyMaps();
}
+ if (keycode == 0) {
+ /*
+ * This means we had a pure modifier keypress or
+ * something similar which is a TO DO.
+ */
+ return NoSymbol;
+ }
+
virtualKey = (char) (keycode >> 16);
c = (keycode) & 0xffff;
if (c > 255) {
@@ -240,7 +248,7 @@ TkpGetString(
* Just return NULL if the character is a function key or another
* non-printing key.
*/
- if (c == 0x10) {
+ if (c == 0x10 || (eventPtr->xany.send_event == -1)) {
len = 0;
} else {
hPtr = Tcl_FindHashEntry(&keycodeTable, (char *) virtualKey);
@@ -487,6 +495,30 @@ TkpGetKeySym(dispPtr, eventPtr)
&& (eventPtr->xkey.state & LockMask))) {
index += 1;
}
+ if (eventPtr->xany.send_event == -1) {
+ /* We use -1 as a special signal for a pure modifier */
+ int modifier = eventPtr->xkey.keycode;
+ if (modifier == cmdKey) {
+ return XK_Alt_L;
+ } else if (modifier == shiftKey) {
+ return XK_Shift_L;
+ } else if (modifier == alphaLock) {
+ return XK_Caps_Lock;
+ } else if (modifier == optionKey) {
+ return XK_Meta_L;
+ } else if (modifier == controlKey) {
+ return XK_Control_L;
+ } else if (modifier == rightShiftKey) {
+ return XK_Shift_R;
+ } else if (modifier == rightOptionKey) {
+ return XK_Meta_R;
+ } else if (modifier == rightControlKey) {
+ return XK_Control_R;
+ } else {
+ /* If we get here, we probably need to implement something new */
+ return NoSymbol;
+ }
+ }
sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, index);
/*