1In this section you will be given information about key concepts in X11 and Xnee. It is
2vital that you read through this chapter.
3
4@section  Modes
5@cindex modes
6Xnee has four modes:
7@itemize @bullet
8@item	record
9@item	replay
10@item	retype
11@item	distribute
12@end itemize
13The distribution mechanism can be used together with the other three.
14
15@subsection  Record
16@cindex recording
17When record mode is used Xnee receives a copy of the data sent to and from the
18X server. The copy is printed to a file. Xnee can record the whole X11
19protocol, not just mouse and keyboard events.
20
21@ifnotinfo
22This picture gives an overview of Xnee and the files used when recording.
23@*
24@image{xnrec, 10cm}
25@end ifnotinfo
26
27
28@subsection  Replay
29@cindex replaying
30When replay mode is used Xnee reads data from a file or stdin. These data is
31either sent to the server (if it is a keyboard or a mouse event) or used to
32synchronise with (if any of the other data).
33
34@ifnotinfo
35This picture gives an overview of Xnee and the files used when replaying.
36@*
37@image{xnrep, 10cm}
38@end ifnotinfo
39
40
41@subsection  Retype
42@cindex retype
43Xnee can retype the contents of a text file. This is useful when combining
44replaying of different recorded session. You can change the text written in
45for example an editor (e.g emacs) without having to re-record the complete
46sessions.
47
48@subsection  Distribution
49@cindex distributing
50Xnee can fake mouse and keyboard events on multiple displays. This
51distribution mechanism can be used when recording, replaying or retyping.
52
53
54@section  Ranges
55@cindex ranges
56What data to record is specified using ranges. Ranges has a start value and
57a stop value. The following data can be recorded:
58
59@multitable  @columnfractions .10 .45 .45
60@item
61@tab @b{Xnee name}
62@tab @b{X Protocol Name}
63
64@item
65@tab core-requests
66@tab Request
67
68@item
69@tab device-event
70@tab Event
71
72@item
73@tab delivered-event
74@tab Event
75
76@item
77@tab error
78@tab Error
79
80@item
81@tab reply
82@tab Reply
83
84@item
85@tab ext-requests.ext-major
86@tab Extension Request
87
88@item
89@tab ext-requests.ext-minor
90@tab Extension Request
91
92@item
93@tab ext-replies.ext-major
94@tab Extension Reply
95
96@item
97@tab ext-replies.ext-minor
98@tab Extension Reply
99
100@end multitable
101When specifying the ranges when using xnee you can either type the integer value
102of the data or the name of the data. To find out what number belongs to what
103data name, you can use the @code{--print-data-name} option. For an explanation
104of the X protocol data, please read the "X Record Extension Library" or the
105"Record Extension Protocol Specification".
106
107
108@section  First and last motion event
109Xnee has the ability to skip recording of succesive motion events with no
110other data in between. This option is intended to reduce the number of data
111recorded by leaving out unnecessary data. This feature can be invoked with
112the @code{--first-last} flag.
113
114@section  Delay
115Sometimes when Xnee starts recording data, the keyrelease (caused by pressing and
116releasing RETURN to execute the Xnee command line) is recorded. This single
117keyrelease (with no corresponding keypress) might confuse the X server.
118With the @code{--time <secs>} option Xnee can be paused for a number of seconds
119before recording/replaying/retyping starts.
120
121
122@section  Verbose
123When enabling verbose mode (@code{--verbose}) Xnee prints a lot of information
124about it's state. This option is only intended for runtime debugging.
125
126@section  Human printouts
127Sometimes it's hard to decide what data to use when synchronising. To do this
128you have to analyse what data is sent from the server when recording. Instead of
129reading the data number, s tring representation of the data is printed out.
130To enable this option, use the @code{--human-printouts}.
131
132
133
134@section  Invoking Xnee
135
136@subsection  Command line syntax
137@cindex command line syntax
138To get information about how to use Xnee's command line options please use the man page(s).
139
140@subsection  Project file
141To use a Project file use the @code{--project} option,  e.g
142@code{cnee --project xnee/projects/netscape.xns}.
143
144@subsection  Session file
145To use a session file use the @code{--file} option,  e.g
146@code{cnee --file user1_session.xns}
147
148
149@section  Interupting Xnee
150@cindex   Interupting xnee
151Interupting Xnee when recording or replaying can be done as follows
152@itemize @bullet
153@item	user specified modifier and key
154@item	limit the number of data to record
155@item	sending a SIGTERM signal (e.g pressing Control-c in a terminal window)
156@end itemize
157The prefered way to interrupt xnee is to use the modifier+key.
158
159@subsection modifier and key
160@cindex modifier
161@cindex key
162It is possible to specify a modifier (e.g Control button) and a key (e.g 'a')
163that will stop the Xnee session. When using this option make sure that the
164modifier/key is not used in any way by the applications you are recording.
165You can specify a key+modifier to stop, pause and resume xnee. You can also
166insert a mark in the recorded session file.
167
168@subsection limit the number of data to record
169By specifying the number of data to record (@code{--loops}) xnee stops when this number
170of data is received from the server. When replaying the same amount of data
171is replayed.
172
173@subsection	sending a SIGTERM signal
174@cindex SIGTERM
175The easiest way to send a signal to a process is by launching Xnee
176from a terminal window (e.g xterm) and then press Control-c which will
177send the SIGTERM signal to Xnee. When replaying it can sometimes be
178hard to move the pointer into the terminal window (e.g if a lot of
179motion events were recorded that will let you compete with Xnee on
180where the mouse pointer shall be located.  Beleive me, you'll end up
181lossing that battle).
182
183When using Control-c to stop Xnee you must be aware of that the pressing of the Control key gets recorded. When replaying a recorded session ending with pressing of Control your apps may think you are pressing the Control key. A simple solution for this is to press and release the Control.
184
185@subsection  Stop Xnee with key combination
186@cindex      Stop Xnee with key combination
187Xnee stops its current action when the user presses the key
188combination as specified during setup. Xnee will be shut gracefully.
189
190@subsection  Pause Xnee with key combination
191@cindex      Pause Xnee with key combination
192Xnee pause its current action when the user presses the key
193combination as specified during setup. Xnee will be in paused mode until
194the user stops or resumes Xnee.
195
196@subsection  Pause Xnee with key combination
197@cindex      Pause Xnee with key combination
198Xnee resumes its current paused action when the user presses the key
199combination as specified during setup. Xnee will continue where it was
200paused.
201
202@subsection  Insert marks Xnee with key combination
203@cindex      Insert marks Xnee with key combination
204When the user presses the key combination as specified during setup
205Xnee will print a mark in the session file containing a time stamp. This
206feature is intended be used when you want to mark an interresting time/event
207during recording. After recording has finished you can add Xnee scripting
208calls to Xnee which will be interpreted and executed as if they were recorded.
209
210
211@subsection Limit number of data to record
212There a a few ways to limit the number of data Xnee records.
213@itemize @bullet
214@item	limit the events to recored
215@item	limit the data to recored
216@item	limit the time to recored
217@item	send a signal to xnee (SIGTERM)
218@item	use a selfmade record callback function
219@end itemize
220
221@subsection Limit the events to record
222@cindex limit the events
223When having received the specified amount of events from the server, Xnee
224stops the recording. For more information on how to use this option, read
225the man page for cnee or the user manual for gnee.
226
227@subsection Limit the data to record
228@cindex limit the data
229When having received the specified amount of data from the server, Xnee
230stops the recording. For more information on how to use this option, read
231the man page for cnee or the user manual for gnee.
232
233@subsection Limit the time to record
234@cindex limit the events
235When having recorded for the specified amount of time from the server, Xnee
236stops the recording. For more information on how to use this option, read
237the man page for cnee or the user manual for gnee.
238
239@subsection Send SIGTERM to Xnee
240@cindex SIGTERM
241The easiest way to send a signal to a process is by launching Xnee from a
242terminal window (e.g xterm). By pressing Control-c xterm sends the
243SIGTERM signal to Xnee. When replaying it can sometimes be hard to
244move the pointer into the terminal window (e.g if a lot of motion
245events were recorded that will let you compete with Xnee on where
246the mouse pointer shall be located. Beleive me, you'll end up lossing
247that battle).
248
249
250@section  Xnee plugins
251@cindex plugins
252Xnee supports plugins since version 1.07. For information about how to write
253plugins, download the source code and look at the plugin example which is
254delivered with Xnee.
255
256