summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorculler <culler>2020-05-14 21:46:39 (GMT)
committerculler <culler>2020-05-14 21:46:39 (GMT)
commit41617cb3f6dc92eeb21c55eb776e0135bfa6e935 (patch)
treec5c158981c47137d2901fff593e90c7f4ceee674 /generic
parent3936fed2e4bd2538177704d1624300aa7d8e52ef (diff)
downloadtk-41617cb3f6dc92eeb21c55eb776e0135bfa6e935.zip
tk-41617cb3f6dc92eeb21c55eb776e0135bfa6e935.tar.gz
tk-41617cb3f6dc92eeb21c55eb776e0135bfa6e935.tar.bz2
Add the macOS support, using the TkWheelEvent but not the TkKeyEvent since macOS no longer needs trans_chars.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBind.c6
-rw-r--r--generic/tkInt.h28
2 files changed, 17 insertions, 17 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 48f51e3..79f6cb1 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -3139,7 +3139,7 @@ ExpandPercents(
break;
case 'D':
if (flags & WHEEL) {
- SET_NUMBER((int)evPtr->xbutton.button); /* mis-use button field for this */
+ SET_NUMBER(((TkWheelEvent *)evPtr)->delta);
}
break;
case 'E':
@@ -3796,7 +3796,7 @@ HandleEventGenerate(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- union { XEvent general; XVirtualEvent virtual; } event;
+ union { XEvent general; XVirtualEvent virtual; TkWheelEvent wheel;} event;
const char *p;
const char *name;
@@ -4022,7 +4022,7 @@ HandleEventGenerate(
return TCL_ERROR;
}
if (flags & WHEEL) {
- event.general.xbutton.button = (unsigned)number; /* mis-use button field for this */
+ event.wheel.delta = number;
} else {
badOpt = 1;
}
diff --git a/generic/tkInt.h b/generic/tkInt.h
index fd124d5..64e7947 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -854,7 +854,7 @@ typedef struct TkWindow {
typedef struct {
XKeyEvent keyEvent; /* The real event from X11. */
-#if defined(_WIN32) || defined(MAC_OSX_TK)
+#if defined(_WIN32)
char trans_chars[XMaxTransChars];
/* translated characters */
unsigned char nbytes; /* Length of trans_chars. */
@@ -872,19 +872,19 @@ typedef struct {
} TkKeyEvent;
typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window it is reported relative to */
- Window root; /* root window that the event occured on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- int delta; /* delta */
- unsigned int button; /* detail */
- Bool same_screen; /* same screen flag */
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window it is reported relative to */
+ Window root; /* root window that the event occured on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* pointer x, y coordinates in event window */
+ int x_root, y_root; /* coordinates relative to root */
+ int delta; /* delta */
+ unsigned int state; /* detail */
+ Bool same_screen; /* same screen flag */
} TkWheelEvent;
/*