summaryrefslogtreecommitdiff
path: root/efl/ecore_input
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-01-08 22:18:49 +0100
committerDave Andreoli <dave@gurumeditation.it>2016-01-08 22:18:49 +0100
commitf3e6315413e84fedc08cee4478c5784cd47cd163 (patch)
tree8458cc776bd2370e5d04f1d2d52220580b1bb563 /efl/ecore_input
parent592467c7bdf3df32621057a500bd4436648fe1b7 (diff)
Add a new module: ecore_input
as always with docs and example
Diffstat (limited to 'efl/ecore_input')
-rw-r--r--efl/ecore_input/efl.ecore_input.pxd244
-rw-r--r--efl/ecore_input/efl.ecore_input.pyx112
-rw-r--r--efl/ecore_input/efl.ecore_input_events.pxi377
3 files changed, 733 insertions, 0 deletions
diff --git a/efl/ecore_input/efl.ecore_input.pxd b/efl/ecore_input/efl.ecore_input.pxd
new file mode 100644
index 0000000..ce0de79
--- /dev/null
+++ b/efl/ecore_input/efl.ecore_input.pxd
@@ -0,0 +1,244 @@
1# Copyright (C) 2007-2015 various contributors (see AUTHORS)
2#
3# This file is part of Python-EFL.
4#
5# Python-EFL is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 3 of the License, or (at your option) any later version.
9#
10# Python-EFL is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17
18from efl.eina cimport Eina_Bool
19from efl.ecore cimport Ecore_Event_Handler, ecore_event_handler_add, \
20 ecore_event_handler_del
21
22
23cdef extern from "Ecore_Input.h":
24
25 ####################################################################
26 # Enums
27 #
28 cpdef enum Ecore_Event_Modifier: # this is not really an enum
29 ECORE_EVENT_MODIFIER_SHIFT
30 ECORE_EVENT_MODIFIER_CTRL
31 ECORE_EVENT_MODIFIER_ALT
32 ECORE_EVENT_MODIFIER_WIN
33 ECORE_EVENT_MODIFIER_SCROLL
34 ECORE_EVENT_MODIFIER_NUM
35 ECORE_EVENT_MODIFIER_CAPS
36 ECORE_EVENT_LOCK_SCROLL
37 ECORE_EVENT_LOCK_NUM
38 ECORE_EVENT_LOCK_CAPS
39 ECORE_EVENT_LOCK_SHIFT
40 ECORE_EVENT_MODIFIER_ALTGR
41 ctypedef enum Ecore_Event_Modifier:
42 pass
43
44 ####################################################################
45 # events (not exposed to python)
46 #
47 int ECORE_EVENT_KEY_DOWN
48 int ECORE_EVENT_KEY_UP
49 int ECORE_EVENT_MOUSE_BUTTON_DOWN
50 int ECORE_EVENT_MOUSE_BUTTON_UP
51 int ECORE_EVENT_MOUSE_MOVE
52 int ECORE_EVENT_MOUSE_IN
53 int ECORE_EVENT_MOUSE_OUT
54 int ECORE_EVENT_MOUSE_WHEEL
55
56 ####################################################################
57 # Data Types
58 #
59 ctypedef void *Ecore_Window
60
61 ctypedef struct _EventPoint:
62 int x
63 int y
64
65 ctypedef struct _EventMulti:
66 int device
67 double radius
68 double radius_x
69 double radius_y
70 double pressure
71 double angle
72 double x
73 double y
74 _EventPoint root
75
76 ctypedef struct Ecore_Event_Key:
77 const char *keyname
78 const char *key
79 const char *string
80 const char *compose
81 Ecore_Window window
82 Ecore_Window root_window
83 Ecore_Window event_window
84 unsigned int timestamp
85 unsigned int modifiers
86 int same_screen
87 unsigned int keycode
88 void *data
89
90 ctypedef struct Ecore_Event_Mouse_Button:
91 Ecore_Window window
92 Ecore_Window root_window
93 Ecore_Window event_window
94 unsigned int timestamp
95 unsigned int modifiers
96 unsigned int buttons
97 unsigned int double_click
98 unsigned int triple_click
99 int same_screen
100 int x
101 int y
102 _EventPoint root
103 _EventMulti multi
104
105 ctypedef struct Ecore_Event_Mouse_Wheel:
106 Ecore_Window window
107 Ecore_Window root_window
108 Ecore_Window event_window
109 unsigned int timestamp
110 unsigned int modifiers
111 int same_screen
112 int direction
113 int z
114 int x
115 int y
116 _EventPoint root
117
118 ctypedef struct Ecore_Event_Mouse_Move:
119 Ecore_Window window
120 Ecore_Window root_window
121 Ecore_Window event_window
122 unsigned int timestamp
123 unsigned int modifiers
124 int same_screen
125 int x
126 int y
127 _EventPoint root
128 _EventMulti multi
129
130 ctypedef struct Ecore_Event_Mouse_IO:
131 Ecore_Window window
132 Ecore_Window event_window
133 unsigned int timestamp
134 unsigned int modifiers
135 int x
136 int y
137
138
139 ####################################################################
140 # Functions
141 #
142 int ecore_event_init()
143 int ecore_event_shutdown()
144
145
146####################################################################
147# Python classes
148#
149from efl.ecore cimport Event, EventHandler
150
151
152cdef class Window:
153 # Can we do something with this opaque stuct ?
154 pass
155
156
157cdef class InputEventHandler(EventHandler):
158 pass
159
160
161cdef class EventPoint:
162 cdef readonly int x
163 cdef readonly int y
164
165
166cdef class EventMulti:
167 cdef readonly int device
168 cdef readonly double radius
169 cdef readonly double radius_x
170 cdef readonly double radius_y
171 cdef readonly double pressure
172 cdef readonly double angle
173 cdef readonly double x
174 cdef readonly double y
175 cdef readonly double root_x
176 cdef readonly double root_y
177
178
179cdef class EventKey(Event):
180 cdef readonly object keyname
181 cdef readonly object key
182 cdef readonly object string
183 cdef readonly object compose
184 ## Can we do something with this Window opaque struct ?
185 # cdef readonly Window window
186 # cdef readonly Window root_window
187 # cdef readonly Window event_window
188 cdef readonly unsigned int modifiers
189 cdef readonly unsigned int timestamp
190 cdef readonly unsigned int keycode
191 cdef readonly object same_screen
192
193
194cdef class EventMouseButton(Event):
195 # cdef readonly Window window
196 # cdef readonly Window root_window
197 # cdef readonly Window event_window
198 cdef readonly unsigned int modifiers
199 cdef readonly unsigned int timestamp
200 cdef readonly unsigned int buttons
201 cdef readonly object double_click
202 cdef readonly object triple_click
203 cdef readonly object same_screen
204 cdef readonly int x
205 cdef readonly int y
206 cdef readonly EventPoint root
207 cdef readonly EventMulti multi
208
209
210cdef class EventMouseMove(Event):
211 # cdef readonly Window window
212 # cdef readonly Window root_window
213 # cdef readonly Window event_window
214 cdef readonly unsigned int modifiers
215 cdef readonly unsigned int timestamp
216 cdef readonly object same_screen
217 cdef readonly int x
218 cdef readonly int y
219 cdef readonly EventPoint root
220 cdef readonly EventMulti multi
221
222
223cdef class EventMouseIO(Event):
224 # cdef readonly Window window
225 # cdef readonly Window event_window
226 cdef readonly unsigned int modifiers
227 cdef readonly unsigned int timestamp
228 cdef readonly int x
229 cdef readonly int y
230
231
232cdef class EventMouseWheel(Event):
233 # cdef readonly Window window
234 # cdef readonly Window root_window
235 # cdef readonly Window event_window
236 cdef readonly unsigned int modifiers
237 cdef readonly unsigned int timestamp
238 cdef readonly object same_screen
239 cdef readonly int direction
240 cdef readonly int z
241 cdef readonly int x
242 cdef readonly int y
243 cdef readonly EventPoint root
244
diff --git a/efl/ecore_input/efl.ecore_input.pyx b/efl/ecore_input/efl.ecore_input.pyx
new file mode 100644
index 0000000..1a7f891
--- /dev/null
+++ b/efl/ecore_input/efl.ecore_input.pyx
@@ -0,0 +1,112 @@
1# Copyright (C) 2007-2015 various contributors (see AUTHORS)
2#
3# This file is part of Python-EFL.
4#
5# Python-EFL is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 3 of the License, or (at your option) any later version.
9#
10# Python-EFL is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17
18"""
19
20:mod:`efl.ecore_input` Module
21#############################
22
23.. versionadded:: 1.17
24
25This module provide access to the low-level input events, you usually
26don't need to use this stuff, unless you need some sort of custom event
27handling.
28
29To be informed about specific events just use one of the
30on_*_add(func, \*args, \**kargs) functions, the callback given will be fired
31when events occur.
32
33Callback signature is::
34
35 func(event, *args, **kargs) → int
36
37Where ``event`` will be a class relative to the specific event (such as
38:class:`EventKey`) All the additional arguments and keyword arguments passed
39in the \*_add function will be passed back in the callback.
40
41In some events (EventKey at least) the callback function may return
42ecore.ECORE_CALLBACK_DONE or ecore.ECORE_CALLBACK_PASS_ON to block the
43event propagation down the chain or not.
44
45To stop receiving event use :func:`efl.ecore.EventHandler.delete`
46
47
48Enumerations
49============
50
51.. _Ecore_Event_Modifier:
52
53Ecore_Event_Modifier
54--------------------
55
56.. data:: ECORE_EVENT_MODIFIER_SHIFT
57
58.. data:: ECORE_EVENT_MODIFIER_CTRL
59
60.. data:: ECORE_EVENT_MODIFIER_ALT
61
62.. data:: ECORE_EVENT_MODIFIER_WIN
63
64.. data:: ECORE_EVENT_MODIFIER_SCROLL
65
66.. data:: ECORE_EVENT_MODIFIER_NUM
67
68.. data:: ECORE_EVENT_MODIFIER_CAPS
69
70.. data:: ECORE_EVENT_LOCK_SCROLL
71
72.. data:: ECORE_EVENT_LOCK_NUM
73
74.. data:: ECORE_EVENT_LOCK_CAPS
75
76.. data:: ECORE_EVENT_LOCK_SHIFT
77
78.. data:: ECORE_EVENT_MODIFIER_ALTGR
79
80
81Classes and Functions
82=====================
83
84"""
85
86
87import atexit
88import traceback
89
90
91def init():
92 """ Initialize the Ecore Input library
93
94 .. note:: You never need to call this, it is automatically called at module
95 import
96 """
97 ecore_event_init()
98 _ecore_input_events_register()
99
100def shutdown():
101 """ Shutdown the Ecore Input library.
102
103 .. note:: You never need to call this, it is automatically called at exit
104
105 """
106 ecore_event_shutdown()
107
108
109include "efl.ecore_input_events.pxi"
110
111init()
112atexit.register(shutdown)
diff --git a/efl/ecore_input/efl.ecore_input_events.pxi b/efl/ecore_input/efl.ecore_input_events.pxi
new file mode 100644
index 0000000..6824f9a
--- /dev/null
+++ b/efl/ecore_input/efl.ecore_input_events.pxi
@@ -0,0 +1,377 @@
1# Copyright (C) 2007-2015 various contributors (see AUTHORS)
2#
3# This file is part of Python-EFL.
4#
5# Python-EFL is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 3 of the License, or (at your option) any later version.
9#
10# Python-EFL is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17
18
19from efl.utils.conversions cimport _ctouni
20from efl.ecore cimport _event_mapping_register, _event_mapping_get
21
22
23cdef int _input_events_registered = 0
24
25cdef int _ecore_input_events_register() except 0:
26 global _input_events_registered
27
28 if _input_events_registered == 0:
29 _event_mapping_register(ECORE_EVENT_KEY_DOWN, EventKey)
30 _event_mapping_register(ECORE_EVENT_KEY_UP, EventKey)
31 _event_mapping_register(ECORE_EVENT_MOUSE_BUTTON_DOWN, EventMouseButton)
32 _event_mapping_register(ECORE_EVENT_MOUSE_BUTTON_UP, EventMouseButton)
33 _event_mapping_register(ECORE_EVENT_MOUSE_MOVE, EventMouseMove)
34 _event_mapping_register(ECORE_EVENT_MOUSE_IN, EventMouseIO)
35 _event_mapping_register(ECORE_EVENT_MOUSE_OUT, EventMouseIO)
36 _event_mapping_register(ECORE_EVENT_MOUSE_WHEEL, EventMouseWheel)
37
38 _input_events_registered = 1
39
40 return 1
41
42
43cdef Eina_Bool _input_event_handler_cb(void *data, int type, void *event) with gil:
44 cdef EventHandler handler
45 cdef Eina_Bool r
46
47 assert event != NULL
48 assert data != NULL, "data should not be NULL!"
49 handler = <EventHandler>data
50 assert type == handler.type, "handler type isn't the same as event type!"
51
52 try:
53 r = handler._exec(event)
54 except Exception:
55 traceback.print_exc()
56 r = 0
57
58 return r
59
60
61cdef class InputEventHandler(EventHandler):
62 """
63 The event handler class
64
65 You never instantiate this class directly, instead use one of the
66 on_*_add() functions.
67 """
68 def __init__(self, int type, func, *args, **kargs):
69
70 if not callable(func):
71 raise TypeError("Parameter 'func' must be callable")
72
73 event_cls = _event_mapping_get(type)
74 if event_cls is None:
75 raise ValueError("Unknow Ecore_Event type %d" % type)
76
77 self.type = type
78 self.event_cls = event_cls
79 self.func = func
80 self.args = args
81 self.kargs = kargs
82 self._set_obj(ecore_event_handler_add(type, _input_event_handler_cb,
83 <void *>self))
84
85
86cdef class EventKey(Event):
87 """ EventKey()
88
89 Contains information about an Ecore keyboard event.
90
91 .. seealso :: :func:`on_key_down_add`, :func:`on_key_up_add`
92
93 :ivar str keyname: The key name
94 :ivar str key: The key symbol
95 :ivar str string:
96 :ivar int compose: Final string corresponding to the key symbol composed
97 :ivar int timestamp: Time when the event occurred.
98 :ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
99 :ivar bool same_screen: Same screen flag
100 :ivar int keycode: Key scan code numeric value
101
102 """
103 cdef int _set_obj(self, void *o) except 0:
104 cdef Ecore_Event_Key *obj
105 obj = <Ecore_Event_Key*>o
106 self.keyname = _ctouni(obj.keyname)
107 self.key = _ctouni(obj.key)
108 self.string = _ctouni(obj.string)
109 self.compose = _ctouni(obj.compose)
110 ## Can we do something with this Window opaque struct ?
111 # self.window = Window(<unsigned long><void*>obj.window)
112 # self.root_window = Window(<unsigned long><void*>obj.root_window)
113 # self.event_window = Window(<unsigned long><void*>obj.event_window)
114 self.timestamp = obj.timestamp
115 self.modifiers = obj.modifiers
116 self.same_screen = bool(obj.same_screen)
117 self.keycode = obj.keycode
118 return 1
119
120
121cdef class EventPoint:
122 """
123 :ivar int x: x coordinate
124 :ivar int y: y coordinate
125 """
126 def __init__(self, int x, int y):
127 self.x = x
128 self.y = y
129
130 def __repr__(self):
131 return "<EventPoint x=%d y=%d>" % (self.x, self.y)
132
133cdef class EventMulti:
134 """
135 :ivar int device: 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers)
136 :ivar double radius: radius of press point - radius_x and y if its an ellipse (radius is the average of the 2)
137 :ivar double radius_x:
138 :ivar double radius_y:
139 :ivar double pressure: 1.0 == normal, > 1.0 == more, 0.0 == none
140 :ivar double angle: relative to perpendicular (0.0 == perpendicular), in degrees
141 :ivar double x: with sub-pixel precision, if available
142 :ivar double y: with sub-pixel precision, if available
143 :ivar double root_x: with sub-pixel precision, if available
144 :ivar double root_y: with sub-pixel precision, if available
145 """
146 def __init__(self, int device, double radius, double radius_x, double radius_y,
147 double pressure, double angle, double x, double y,
148 double root_x, double root_y):
149 self.device = device
150 self.radius = radius
151 self.radius_x = radius_x
152 self.radius_y = radius_y
153 self.pressure = pressure
154 self.angle = angle
155 self.x = x
156 self.y = y
157 self.root_x = root_x
158 self.root_y = root_y
159
160 def __repr__(self):
161 return "<EventMulti>"
162
163
164cdef class EventMouseButton(Event):
165 """ EventMouseButton()
166
167 Contains information about an Ecore mouse button event.
168
169 .. seealso :: :func:`on_mouse_button_down_add`, :func:`on_mouse_button_up_add`
170
171 :ivar int timestamp: Time when the event occurred
172 :ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
173 :ivar int buttons: The button that was used
174 :ivar bool double_click: Double click event
175 :ivar bool triple_click: Triple click event
176 :ivar bool same_screen: Same screen flag
177 :ivar int x: x coordinate relative to window where event happened
178 :ivar int y: y coordinate relative to window where event happened
179 :ivar EventPoint root: :class:`EventPoint` Coordinates relative to root window
180
181 """
182 cdef int _set_obj(self, void *o) except 0:
183 cdef Ecore_Event_Mouse_Button *obj
184 obj = <Ecore_Event_Mouse_Button*>o
185 # self.window = Window(<unsigned long><void*>obj.window)
186 # self.root_window = Window(<unsigned long><void*>obj.root_window)
187 # self.event_window = Window(<unsigned long><void*>obj.event_window)
188 self.timestamp = obj.timestamp
189 self.modifiers = obj.modifiers
190 self.buttons = obj.buttons
191 self.double_click = bool(obj.double_click)
192 self.triple_click = bool(obj.triple_click)
193 self.same_screen = bool(obj.same_screen)
194 self.x = obj.x
195 self.y = obj.y
196 self.root = EventPoint(obj.root.x, obj.root.y)
197 self.multi = EventMulti(obj.multi.device, obj.multi.radius,
198 obj.multi.radius_x, obj.multi.radius_y,
199 obj.multi.pressure, obj.multi.angle,
200 obj.multi.x, obj.multi.y,
201 obj.multi.root.x, obj.multi.root.y)
202 return 1
203
204
205cdef class EventMouseMove(Event):
206 """ EventMouseMove()
207
208 Contains information about an Ecore mouse move event.
209
210 .. seealso :: :func:`on_mouse_move_add`
211
212 :ivar int timestamp: Time when the event occurred
213 :ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
214 :ivar bool same_screen: Same screen flag
215 :ivar int x: x coordinate relative to window where event happened
216 :ivar int y: y coordinate relative to window where event happened
217 :ivar EventPoint root: Coordinates relative to root window
218
219 """
220 cdef int _set_obj(self, void *o) except 0:
221 cdef Ecore_Event_Mouse_Move *obj
222 obj = <Ecore_Event_Mouse_Move *>o
223 # self.window = Window(<unsigned long><void*>obj.window)
224 # self.root_window = Window(<unsigned long><void*>obj.root_window)
225 # self.event_window = Window(<unsigned long><void*>obj.event_window)
226 self.timestamp = obj.timestamp
227 self.modifiers = obj.modifiers
228 self.same_screen = bool(obj.same_screen)
229 self.x = obj.x
230 self.y = obj.y
231 self.root = EventPoint(obj.root.x, obj.root.y)
232 self.multi = EventMulti(obj.multi.device, obj.multi.radius,
233 obj.multi.radius_x, obj.multi.radius_y,
234 obj.multi.pressure, obj.multi.angle,
235 obj.multi.x, obj.multi.y,
236 obj.multi.root.x, obj.multi.root.y)
237 return 1
238
239
240cdef class EventMouseIO(Event):
241 """ EventMouseIO()
242
243 Contains information about an Ecore mouse input/output event.
244
245 .. seealso :: :func:`on_mouse_in_add`, :func:`on_mouse_out_add`
246
247 :ivar int timestamp: Time when the event occurred
248 :ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
249 :ivar int x: x coordinate relative to window where event happened
250 :ivar int y: y coordinate relative to window where event happened
251
252 """
253 cdef int _set_obj(self, void *o) except 0:
254 cdef Ecore_Event_Mouse_IO *obj
255 obj = <Ecore_Event_Mouse_IO *>o
256 # self.window = Window(<unsigned long><void*>obj.window)
257 # self.event_window = Window(<unsigned long><void*>obj.event_window)
258 self.timestamp = obj.timestamp
259 self.modifiers = obj.modifiers
260 self.x = obj.x
261 self.y = obj.y
262 return 1
263
264
265cdef class EventMouseWheel(Event):
266 """ EventMouseWheel()
267
268 Contains information about an Ecore mouse wheel event.
269
270 .. seealso :: :func:`on_mouse_wheel_add`
271
272 :ivar int timestamp: Time when the event occurred
273 :ivar int modifiers: :ref:`Ecore_Event_Modifier` The OR combination of modifiers key
274 :ivar bool same_screen: Same screen flag
275 :ivar int direction: Orientation of the wheel (horizontal/vertical)
276 :ivar int z: Value of the wheel event (+1/-1)
277 :ivar int x: x coordinate relative to window where event happened
278 :ivar int y: y coordinate relative to window where event happened
279 :ivar EventPoint root: Coordinates relative to root window.
280
281 """
282 cdef int _set_obj(self, void *o) except 0:
283 cdef Ecore_Event_Mouse_Wheel *obj
284 obj = <Ecore_Event_Mouse_Wheel *>o
285 # self.window = Window(<unsigned long><void*>obj.window)
286 # self.root_window = Window(<unsigned long><void*>obj.root_window)
287 # self.event_window = Window(<unsigned long><void*>obj.event_window)
288 self.timestamp = obj.timestamp
289 self.modifiers = obj.modifiers
290 self.same_screen = bool(obj.same_screen)
291 self.direction = obj.direction
292 self.z = obj.z
293 self.x = obj.x
294 self.y = obj.y
295 self.root = EventPoint(obj.root.x, obj.root.y)
296 return 1
297
298
299def on_key_down_add(func, *args, **kargs):
300 """
301 Creates an ecore event handler for the ECORE_EVENT_KEY_DOWN event.
302
303 :return: :class:`InputEventHandler`
304
305 .. seealso:: :class:`EventKey`
306 """
307 return InputEventHandler(ECORE_EVENT_KEY_DOWN, func, *args, **kargs)
308
309def on_key_up_add(func, *args, **kargs):
310 """
311 Creates an ecore event handler for the ECORE_EVENT_KEY_UP event.
312
313 :return: :class:`InputEventHandler`
314
315 .. seealso:: :class:`EventKey`
316 """
317 return InputEventHandler(ECORE_EVENT_KEY_UP, func, *args, **kargs)
318
319def on_mouse_button_down_add(func, *args, **kargs):
320 """
321 Creates an ecore event handler for the ECORE_EVENT_MOUSE_BUTTON_DOWN event.
322
323 :return: :class:`InputEventHandler`
324
325 .. seealso:: :class:`EventMouseButton`
326 """
327 return InputEventHandler(ECORE_EVENT_MOUSE_BUTTON_DOWN, func, *args, **kargs)
328
329def on_mouse_button_up_add(func, *args, **kargs):
330 """
331 Create an ecore event handler for the ECORE_EVENT_MOUSE_BUTTON_UP event.
332
333 :return: :class:`InputEventHandler`
334
335 .. seealso:: :class:`EventMouseButton`
336 """
337 return InputEventHandler(ECORE_EVENT_MOUSE_BUTTON_UP, func, *args, **kargs)
338
339def on_mouse_move_add(func, *args, **kargs):
340 """
341 Create an ecore event handler for the ECORE_EVENT_MOUSE_MOVE event.
342
343 :return: :class:`InputEventHandler`
344
345 .. seealso:: :class:`EventMouseMove`
346 """
347 return InputEventHandler(ECORE_EVENT_MOUSE_MOVE, func, *args, **kargs)
348
349def on_mouse_in_add(func, *args, **kargs):
350 """
351 Create an ecore event handler for the ECORE_EVENT_MOUSE_IN event.
352
353 :return: :class:`InputEventHandler`
354
355 .. seealso:: :class:`EventMouseIO`
356 """
357 return InputEventHandler(ECORE_EVENT_MOUSE_IN, func, *args, **kargs)
358
359def on_mouse_out_add(func, *args, **kargs):
360 """
361 Create an ecore event handler for the ECORE_EVENT_MOUSE_OUT event.
362
363 :return: :class:`InputEventHandler`
364
365 .. seealso:: :class:`EventMouseIO`
366 """
367 return InputEventHandler(ECORE_EVENT_MOUSE_OUT, func, *args, **kargs)
368
369def on_mouse_wheel_add(func, *args, **kargs):
370 """
371 Create an ecore event handler for the ECORE_EVENT_MOUSE_WHEEL event.
372
373 :return: :class:`InputEventHandler`
374
375 .. seealso:: :class:`EventMouseWheel`
376 """
377 return InputEventHandler(ECORE_EVENT_MOUSE_WHEEL, func, *args, **kargs)