CTmousetrack generates interactive live data.  It captures mouse movement and writes CloudTurbine “x” and “y” channels of mouse cursor position.  A non-CloudTurbine UDP output mode is also supported.  The CTmousetrack class is contained within CTexample.jar.

Usage:

Further information on these command line arguments is provided in the table below.

Command line option Description
-b Number of points per block; i.e., the number of samples per channel in each output ZIP file.  This is forced to 1 for UDP output mode (i.e., each output UDP packet will contain a single x,y data point).
-dt The (approximate) sampling period in milliseconds; that is, the amount of time between sampled data points.
-h Print the command line help message (as shown above).
-host The server host and port when writing via FTP, HTTP or HTTPS or UDP.
-o Location of the “CTdata” directory. Used when writing CT data to a local folder (i.e., “-w LOCAL”). Output CT data will be saved under this base CloudTurbine data directory.
-s Name of the output source.
-t Only maintain the specified amount of data (seconds) in the CloudTurbine source; older data is deleted automatically. Used when writing CT data to a local folder (i.e., “-w LOCAL”).
-u Comma-delimited username and password, used when writing CT data via FTP or HTTPS (not used when write mode is LOCAL, HTTP or UDP).
-w Specifies mode for writing out data; one of LOCAL, FTP, HTTP, HTTPS, or UDP. Data can be directly written to a local folder or to a local or remote server (ftp, http, https, udp). Data written via http or https can be captured using CTweb server.  Data written via udp can be captured using UDP2CT.
-x Turn on CloudTurbine debugging.

 

As an example, if writing CloudTurbine data (i.e., the output mode (“-w”) is LOCAL, FTP, HTTP, or HTTPS) and the sample period is 10msec (“-dt 10”) and the number of points per block is 100 (“-b 100”) then a ZIP file is written (approximately) once per second, containing 100 samples for each channel (“x” and “y”) at 0.01 sec interval each.

Data can optionally be written to a specified host and port via UDP.  Each UDP packet contains a 5 byte header (“MOUSE”), a long integer containing the epoch timestamp (in milliseconds) and single-precision floating point values for x and y mouse position.  If desired, this data can be captured and parsed by UDP2CT.

See the GitHub source code for how simple it is to make a CT source such as this.