summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMouseEvent.c
diff options
context:
space:
mode:
authordas <das@noemail.net>2004-11-11 01:24:28 (GMT)
committerdas <das@noemail.net>2004-11-11 01:24:28 (GMT)
commite2d0976a6698f21d45c026363abe99043b23afe3 (patch)
treec22d22b2f3ad690eeadd7c8e57c9cf5b9eb56b0d /macosx/tkMacOSXMouseEvent.c
parent185f5e86a40785b99c454f5d3a3cb7ec31c0b0a6 (diff)
downloadtk-e2d0976a6698f21d45c026363abe99043b23afe3.zip
tk-e2d0976a6698f21d45c026363abe99043b23afe3.tar.gz
tk-e2d0976a6698f21d45c026363abe99043b23afe3.tar.bz2
* generic/tkMain.c:
* macosx/tkMacOSXAppInit.c (removed): * macosx/Wish.pbproj/project.pbxproj: * macosx/tkMacOSXInit.c: * macosx/tkMacOSXInt.h: changes to make TkAqua dynamically loadable, enabling [package require Tk] from tclsh. Startup code from tkMacOSXAppInit.c moved into tkMacOSXInit.c, added code that notifies the window server that an unbundled executable is a full GUI application after loading Tk. [Patch 1035348] * doc/wm.n: documented [wm attributes] on Mac OS X. [Bug 606665] * macosx/tkMacOSXWm.c: implemented TIP 222 [wm attributes -alpha] on Mac OS X. [Patch 892194] WmIconbitmapCmd: adopted FSRef changes from [wm atttrs -titlepath]. * macosx/tkMacOSXSubwindows.c: synced spacing/formatting with core-8-4-branch. * generic/tkRectOval.c: * macosx/README: * macosx/tkMacOSXDefault.h: * macosx/tkMacOSXDraw.c: * macosx/tkMacOSXInit.c: * macosx/tkMacOSXInt.h: * macosx/tkMacOSXMenu.c: * macosx/tkMacOSXWm.c: forward port from core-8-4-branch of Jim's and my changes for CG drawing and [wm attributes] (corresponds to 8.4 changes dating from 09-18, 07-27, 07-24). * macosx/tkMacOSXMouseEvent.c: endianness fixes. * macosx/Wish.pbproj/project.pbxproj: corrected path to html help inside framework. * macosx/Makefile: prevent parallel make from building several targets at the same time. FossilOrigin-Name: 2cb92ba546de97e1bff0e5eb1d37986387b3f015
Diffstat (limited to 'macosx/tkMacOSXMouseEvent.c')
-rw-r--r--macosx/tkMacOSXMouseEvent.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index cab8a93..168ef73 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -117,6 +117,7 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
int status,err;
MouseEventData mouseEventData, * medPtr = &mouseEventData;
KeyMap keyMap;
+ long modif;
switch (eventPtr->eKind) {
case kEventMouseUp:
@@ -140,19 +141,21 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
}
medPtr->state = 0;
GetKeys(keyMap);
- if (keyMap[1] & 2) {
+ modif = EndianS32_BtoN(*(long*)(&keyMap[1]));
+
+ if (modif & 2) {
medPtr->state |= LockMask;
}
- if (keyMap[1] & 1) {
+ if (modif & 1) {
medPtr->state |= ShiftMask;
}
- if (keyMap[1] & 8) {
+ if (modif & 8) {
medPtr->state |= ControlMask;
}
- if (keyMap[1] & 32768) {
+ if (modif & 32768) {
medPtr->state |= Mod1Mask; /* command key */
}
- if (keyMap[1] & 4) {
+ if (modif & 4) {
medPtr->state |= Mod2Mask; /* option key */
}
if (eventPtr->eKind == kEventMouseDown
@@ -381,7 +384,7 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
TkMacOSXPreprocessMenu();
TkMacOSXHandleMenuSelect(MenuSelect(where),
- theKeys[1] & 4);
+ EndianS32_BtoN(*(long*)(&theKeys[1])) & 4);
Tcl_SetServiceMode(oldMode);
return true; /* TODO: may not be on event on queue. */
}
@@ -678,30 +681,33 @@ TkMacOSXButtonKeyState()
{
unsigned int state = 0;
KeyMap theKeys;
+ long modif;
if (Button() & !gEatButtonUp) {
state |= Button1Mask;
}
GetKeys(theKeys);
+
+ modif = EndianS32_BtoN(*(long*)(&theKeys[1]));
- if (theKeys[1] & 2) {
+ if (modif & 2) {
state |= LockMask;
}
- if (theKeys[1] & 1) {
+ if (modif & 1) {
state |= ShiftMask;
}
- if (theKeys[1] & 8) {
+ if (modif & 8) {
state |= ControlMask;
}
- if (theKeys[1] & 32768) {
+ if (modif & 32768) {
state |= Mod1Mask; /* command key */
}
- if (theKeys[1] & 4) {
+ if (modif & 4) {
state |= Mod2Mask; /* option key */
}