-
Notifications
You must be signed in to change notification settings - Fork 1
/
python-xlib_11.html
176 lines (166 loc) · 8.79 KB
/
python-xlib_11.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created on September 16, 2020 by texi2html 5.0
texi2html was written by:
Lionel Cons <[email protected]> (original author)
Karl Berry <[email protected]>
Olaf Bachmann <[email protected]>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <[email protected]>
-->
<head>
<title>The Python X Library: 5.2 Selecting Events</title>
<meta name="description" content="The Python X Library: 5.2 Selecting Events">
<meta name="keywords" content="The Python X Library: 5.2 Selecting Events">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 5.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:pre}
span.nolinebreak {white-space:pre}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Selecting-Events"></a>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="python-xlib_9.html#Event-Handling" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_10.html#Getting-Events" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_9.html#Event-Handling" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_12.html#Event-Types" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_14.html#X-Objects" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="python-xlib.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="python-xlib_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<hr>
<a name="Selecting-Events-1"></a>
<h2 class="section">5.2 Selecting Events</h2>
<p>To avoid flooding the clients with events in which they have no
interest, they must explicitly tell the server which events they are
interested in. This is done by providing the <code>event_mask</code>
attribute when creating windows with <code>Window.create_window</code> or in
calls to <code>Window.change_attributes</code>. The value of this attribute
is a mask of all types of events the client is interested in on that
particular window. Whenever the server generates an event for a window
which matches the clients event mask on that window, the event will be
sent to the client.
</p>
<p>The following table lists all event masks and the corresponding event
types and classes. All event masks and types are integer constants
defined in the module <code>Xlib.X</code>. Classes have the same name as the
event type, and are defined in <code>Xlib.protocol.event</code>.
</p>
<table>
<tr><td><strong>Mask</strong></td><td><strong>Type and Class</strong></td><td><strong>Generated when</strong></td></tr>
<tr><td>ButtonMotionMask <br> Button1MotionMask <br> Button2MotionMask <br> Button3MotionMask <br> Button4MotionMask <br> Button5MotionMask</td><td>MotionNotify</td><td>Pointer moved with any or a certain button down</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>ButtonPressMask</td><td>ButtonPress</td><td>Pointer button pressed</td></tr>
<tr><td>ButtonReleaseMask</td><td>ButtonRelease</td><td>Pointer button released</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>ColormapChangeMask</td><td>ColormapNotify</td><td>Colormap changed or installed</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>EnterWindowMask</td><td>EnterNotify</td><td>Pointer enters window</td></tr>
<tr><td>LeaveWindowMask</td><td>LeaveNotify</td><td>Pointer leaves window</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>ExposureMask</td><td>Expose <br> NoExpose</td><td>Window needs to be redrawn</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>FocusChangeMask</td><td>FocusIn <br> FocusOut</td><td>Focus changes</td></tr>
<tr><td>KeymapStateMask</td><td>KeymapNotify</td><td>After EnterNotify and FocusIn</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>KeyPressMask</td><td>KeyPress</td><td>Key is pressed</td></tr>
<tr><td>KeyReleaseMask</td><td>ReleasePress</td><td>Key is released</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>PointerMotionMask</td><td>MotionNotify</td><td>Pointer is moved</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>PropertyChangeMask</td><td>PropertyNotify</td><td>Window properties change</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>StructureNotifyMask</td><td>CirculateNotify <br>
ConfigureNotify <br>
DestroyNotify <br>
GravityNotify <br>
MapNotify <br>
ReparentNotify <br>
UnmapNotify</td><td>Window structure changes</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>SubstructureNotifyMask</td><td>CirculateNotify <br>
ConfigureNotify <br>
CreateNotify <br>
DestroyNotify <br>
GravityNotify <br>
MapNotify <br>
ReparentNotify <br>
UnmapNotify</td><td>Child window structure changes</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>ResizeRedirectMask</td><td>ResizeRequest</td><td>Controlling window size change</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>SubstructureRedirectMask</td><td>CirculateRequest <br>
ConfigureRequest <br>
MapRequest</td><td>Controlling changes to child windows</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td>VisibilityChangeMask</td><td>VisibilityNotify</td><td>Window is obscured or visible</td></tr>
</table>
<p>There are also some event types which are always sent to the clients,
regardless of any event masks:
</p>
<table>
<tr><td><strong>Type and Class</strong></td><td><strong>Cut’n’pasting between windows</strong></td></tr>
<tr><td>ClientMessage</td><td>Other client sends message</td></tr>
<tr><td></td><td></td></tr>
<tr><td>MappingMotify</td><td>Keyboard mapping changes</td></tr>
<tr><td></td><td></td></tr>
<tr><td>SelectionClear <br>
SelectionNotify <br>
SelectionRequest</td><td>Cut’n’pasting between windows</td></tr>
</table>
<hr>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="python-xlib_9.html#Event-Handling" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_10.html#Getting-Events" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_9.html#Event-Handling" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_12.html#Event-Types" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_14.html#X-Objects" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="python-xlib.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="python-xlib_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="python-xlib_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated on <i>September 16, 2020</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 5.0</i></a>.
</font>
<br>
</p>
</body>
</html>