Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multitouch
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
multitouch
Commits
9807d347
Commit
9807d347
authored
May 04, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename event classes.
parent
cd83ef17
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
src/events.py
src/events.py
+16
-16
No files found.
src/events.py
View file @
9807d347
class
Basic
Event
(
object
):
class
Event
(
object
):
def
__init__
(
self
,
point
):
def
__init__
(
self
,
point
):
self
.
point
=
point
self
.
point
=
point
...
@@ -17,15 +17,15 @@ class BasicEvent(object):
...
@@ -17,15 +17,15 @@ class BasicEvent(object):
raise
AttributeError
raise
AttributeError
class
DownEvent
(
Basic
Event
):
class
DownEvent
(
Event
):
_name
=
'down'
_name
=
'down'
class
UpEvent
(
Basic
Event
):
class
UpEvent
(
Event
):
_name
=
'up'
_name
=
'up'
class
MoveEvent
(
Basic
Event
):
class
MoveEvent
(
Event
):
_name
=
'move'
_name
=
'move'
def
__str__
(
self
):
def
__str__
(
self
):
...
@@ -34,7 +34,7 @@ class MoveEvent(BasicEvent):
...
@@ -34,7 +34,7 @@ class MoveEvent(BasicEvent):
self
.
point
.
x
,
self
.
point
.
y
,
self
.
point
.
sid
)
self
.
point
.
x
,
self
.
point
.
y
,
self
.
point
.
sid
)
class
Gesture
Event
(
object
):
class
Gesture
(
object
):
def
__init__
(
self
,
x
,
y
):
def
__init__
(
self
,
x
,
y
):
self
.
x
=
x
self
.
x
=
x
self
.
y
=
y
self
.
y
=
y
...
@@ -47,23 +47,23 @@ class GestureEvent(object):
...
@@ -47,23 +47,23 @@ class GestureEvent(object):
return
'<%s (%s, %s)>'
%
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
)
return
'<%s (%s, %s)>'
%
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
)
class
Tap
Event
(
GestureEvent
):
class
Tap
(
Gesture
):
_name
=
'tap'
_name
=
'tap'
class
SingleTap
Event
(
GestureEvent
):
class
SingleTap
(
Gesture
):
_name
=
'single_tap'
_name
=
'single_tap'
class
DoubleTap
Event
(
GestureEvent
):
class
DoubleTap
(
Gesture
):
_name
=
'double_tap'
_name
=
'double_tap'
class
Flick
Event
(
GestureEvent
):
class
Flick
(
Gesture
):
_name
=
'flick'
_name
=
'flick'
def
__init__
(
self
,
x
,
y
,
velocity
):
def
__init__
(
self
,
x
,
y
,
velocity
):
super
(
Flick
Event
,
self
).
__init__
(
x
,
y
)
super
(
Flick
,
self
).
__init__
(
x
,
y
)
self
.
velocity
=
velocity
self
.
velocity
=
velocity
def
__str__
(
self
):
def
__str__
(
self
):
...
@@ -71,11 +71,11 @@ class FlickEvent(GestureEvent):
...
@@ -71,11 +71,11 @@ class FlickEvent(GestureEvent):
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
,
self
.
velocity
)
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
,
self
.
velocity
)
class
Rotate
Event
(
GestureEvent
):
class
Rotate
(
Gesture
):
_name
=
'rotate'
_name
=
'rotate'
def
__init__
(
self
,
cx
,
cy
,
angle
,
n
):
def
__init__
(
self
,
cx
,
cy
,
angle
,
n
):
super
(
Rotate
Event
,
self
).
__init__
(
cx
,
cy
)
super
(
Rotate
,
self
).
__init__
(
cx
,
cy
)
self
.
angle
=
angle
self
.
angle
=
angle
self
.
n
=
n
self
.
n
=
n
...
@@ -84,11 +84,11 @@ class RotateEvent(GestureEvent):
...
@@ -84,11 +84,11 @@ class RotateEvent(GestureEvent):
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
,
self
.
angle
,
self
.
n
)
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
,
self
.
angle
,
self
.
n
)
class
Pinch
Event
(
GestureEvent
):
class
Pinch
(
Gesture
):
_name
=
'pinch'
_name
=
'pinch'
def
__init__
(
self
,
cx
,
cy
,
amount
,
n
):
def
__init__
(
self
,
cx
,
cy
,
amount
,
n
):
super
(
Pinch
Event
,
self
).
__init__
(
cx
,
cy
)
super
(
Pinch
,
self
).
__init__
(
cx
,
cy
)
self
.
amount
=
amount
self
.
amount
=
amount
self
.
n
=
n
self
.
n
=
n
...
@@ -97,11 +97,11 @@ class PinchEvent(GestureEvent):
...
@@ -97,11 +97,11 @@ class PinchEvent(GestureEvent):
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
,
self
.
amount
,
self
.
n
)
(
self
.
__class__
.
__name__
,
self
.
x
,
self
.
y
,
self
.
amount
,
self
.
n
)
class
Pan
Event
(
GestureEvent
):
class
Pan
(
Gesture
):
_name
=
'pan'
_name
=
'pan'
def
__init__
(
self
,
x
,
y
,
dx
,
dy
,
n
):
def
__init__
(
self
,
x
,
y
,
dx
,
dy
,
n
):
super
(
RotateEvent
,
self
).
__init__
(
x
,
y
)
super
(
Pan
,
self
).
__init__
(
x
,
y
)
self
.
dx
=
dx
self
.
dx
=
dx
self
.
dy
=
dy
self
.
dy
=
dy
self
.
n
=
n
self
.
n
=
n
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment