6
6
7
7
.. warning::
8
8
9
- This part of Kivy is still experimental, and his API is subject to change in
9
+ This part of Kivy is still experimental and this API is subject to change in
10
10
a future version.
11
11
12
- This is a class that can record and replay some part of input events. This can
13
- be used for test case , screen saver etc.
12
+ This is a class that can record and replay some input events. This can
13
+ be used for test cases , screen savers etc.
14
14
15
- Once activated, the recorder will listen to any input event, and save some
16
- properties in a file + the delta time. Later, you can play the input file: it
17
- will generate fake touch with saved properties, and dispatch it to the event
18
- loop.
15
+ Once activated, the recorder will listen for any input event and save its
16
+ properties in a file with the delta time. Later, you can play the input file: it
17
+ will generate fake touch events with the saved properties and dispatch it to
18
+ the event loop.
19
19
20
- By default, only the position are saved ('pos' profile and 'sx', 'sy',
21
- attributes). Changes it only if you understand how input is working .
20
+ By default, only the position is saved ('pos' profile and 'sx', 'sy',
21
+ attributes). Change it only if you understand how input handling works .
22
22
23
23
Recording events
24
24
----------------
25
25
26
26
The best way is to use the "recorder" module. Check the :doc:`api-kivy.modules`
27
- documentation for learning about how to activate a module.
27
+ documentation to see how to activate a module.
28
28
29
- When activated, you can press F8 to start the recording. By default, events will
30
- be written at `<currentpath>/recorder.kvi`. When you want to stop recording,
29
+ Once activated, you can press F8 to start the recording. By default, events will
30
+ be written to `<currentpath>/recorder.kvi`. When you want to stop recording,
31
31
press F8 again.
32
32
33
33
You can replay the file by pressing F7.
@@ -60,10 +60,10 @@ def recorder_loop(instance, value):
60
60
Recording more attributes
61
61
-------------------------
62
62
63
- You can extend the attributes to save, at one condition: attributes values must
64
- be simple value , not instance of complex class. Aka, saving shape will not work .
63
+ You can extend the attributes to save on one condition: attributes values must
64
+ be simple values , not instances of complex classes .
65
65
66
- Let's say you want to save angle and pressure of the touch, if available::
66
+ Let's say you want to save the angle and pressure of the touch, if available::
67
67
68
68
from kivy.input.recorder import Recorder
69
69
@@ -80,11 +80,11 @@ def recorder_loop(instance, value):
80
80
Known limitations
81
81
-----------------
82
82
83
- - Unable to save attributes with instance of complex class
84
- - Values that represent time will be not adjusted
85
- - Can replay only complete record, if a begin/update/end event is missing,
86
- this could lead to ghost touch .
87
- - Stopping the replay before the end can lead to ghost touch .
83
+ - Unable to save attributes with instances of complex classes.
84
+ - Values that represent time will not be adjusted.
85
+ - Can replay only complete records. If a begin/update/end event is missing,
86
+ this could lead to ghost touches .
87
+ - Stopping the replay before the end can lead to ghost touches .
88
88
89
89
'''
90
90
@@ -111,57 +111,57 @@ def depack(self, args):
111
111
112
112
113
113
class Recorder (EventDispatcher ):
114
- '''Recorder class, check module documentation for more information.
114
+ '''Recorder class. Please check module documentation for more information.
115
115
'''
116
116
117
117
window = ObjectProperty (None )
118
- '''Window instance to attach the recorder. If None set , it will use the
119
- default one .
118
+ '''Window instance to attach the recorder. If None, it will use the
119
+ default instance .
120
120
121
- :data:`window` is a :class:`~kivy.properties.ObjectProperty`, default to
121
+ :data:`window` is a :class:`~kivy.properties.ObjectProperty` and defaults to
122
122
None.
123
123
'''
124
124
125
125
counter = NumericProperty (0 )
126
126
'''Number of events recorded in the last session.
127
127
128
- :data:`counter` is a :class:`~kivy.properties.NumericProperty`, default to
129
- 0, read-only.
128
+ :data:`counter` is a :class:`~kivy.properties.NumericProperty` and defaults
129
+ to 0, read-only.
130
130
'''
131
131
132
132
play = BooleanProperty (False )
133
- '''Boolean to start/stop the replay of the current file (if exist.)
133
+ '''Boolean to start/stop the replay of the current file (if it exists).
134
134
135
- :data:`play` is a :class:`~kivy.properties.BooleanProperty`, default to
135
+ :data:`play` is a :class:`~kivy.properties.BooleanProperty` and defaults to
136
136
False.
137
137
'''
138
138
139
139
record = BooleanProperty (False )
140
140
'''Boolean to start/stop the recording of input events.
141
141
142
- :data:`record` is a :class:`~kivy.properties.BooleanProperty`, default to
143
- False.
142
+ :data:`record` is a :class:`~kivy.properties.BooleanProperty` and defaults
143
+ to False.
144
144
'''
145
145
146
146
filename = StringProperty ('recorder.kvi' )
147
- '''Filename to save the output of recorder.
147
+ '''Filename to save the output of the recorder.
148
148
149
- :data:`filename` is a :class:`~kivy.properties.StringProperty`, default to
150
- 'recorder.kvi'.
149
+ :data:`filename` is a :class:`~kivy.properties.StringProperty` and defaults
150
+ to 'recorder.kvi'.
151
151
'''
152
152
153
153
record_attrs = ListProperty (['is_touch' , 'sx' , 'sy' ])
154
154
'''Attributes to record from the motion event.
155
155
156
- :data:`record_attrs` is a :class:`~kivy.properties.ListProperty`, default to
157
- ['is_touch', 'sx', 'sy'].
156
+ :data:`record_attrs` is a :class:`~kivy.properties.ListProperty` and
157
+ defaults to ['is_touch', 'sx', 'sy'].
158
158
'''
159
159
160
160
record_profile_mask = ListProperty (['pos' ])
161
161
'''Profile to save in the fake motion event when replayed.
162
162
163
- :data:`record_profile_mask` is a :class:`~kivy.properties.ListProperty`,
164
- default to ['pos'].
163
+ :data:`record_profile_mask` is a :class:`~kivy.properties.ListProperty` and
164
+ defaults to ['pos'].
165
165
'''
166
166
167
167
# internals
0 commit comments