| www.cortex.salk.edu | September 06, 2008 |
|
:: Style
|
Prior to Cortex version C57R10, a touchscreen could only function properly on a single computer Cortex setup. For release C57R10 (and later), the dual computer version of Cortex also works properly with a touchscreen. The code was written for and tested on a Microtouch touchscreen.
Please refer to the document entitled "Dual Computer Cortex Installation Instructions" for the basic dual computer installation instructions. If you have never set up a dual computer version of Cortex before, you may want to set up a basic system first before attempting to use the touchscreen.
On the receive computer:
The latest Microtouch Touchware driver software is available from the Microtouch web site (http://www.microtouch.com). You MUST install the DOS version of the Touchware driver. Currently, the software driver version is Touchware 3.4. You will also want to download the latest version of Microcal (currently, version 7.0).
Prior to Cortex version C57R10, a touchscreen could only function properly on a single computer Cortex setup. For release C57R10 (and later), the dual computer version of Cortex also works properly with a touchscreen. The code was written for and tested on a Microtouch touchscreen.
Please refer to the document entitled "Dual Computer Cortex Installation Instructions" for the basic dual computer installation instructions. If you have never set up a dual computer version of Cortex before, you may want to set up a basic system first before attempting to use the touchscreen.
In order to specify to Cortex that the touchscreen will be used, the following line must be included in the CORTEX.CFG file:
TOUCH_SCREEN < int ms_per_tik > [< store_touch_data >] [< invert_y_data >] For example, the line could be: TOUCH_SCREEN 50 where 50 is the number of milliseconds between queries of the touchscreen (To emulate the touch screen using the mouse, use a negative number for the ms_per_tik value.) Since the calculation of the location of the touch is based upon the "pixels-per-dva" setting in the CORTEX.CFG file, it is imperative that the values are set correctly in the GRAPHICS_SPECS line. (In my test setup with a 17" Microtouch Model 8705 Mitsubishi 17HX monitor, I used the following settings: GRAPHICS_SPECS 640 480 60 20 20 8 NEVER.) In Cortex version 5.9.3 and higher, the optional parameter, < store_touch_data >, was added to the TOUCH_SCREEN parameter of CORTEX.CFG. This parameter allows the user to specify whether or not the touch values should be stored to the EPPbuf, the CODE/ISI buf, both places, or neither place. Valid values are: EPPBUF CODEBUF NEITHER BOTH (default) If no value is provided, the touch data will be stored to both the EPPbuf and CODE/ISI buf. In Cortex version 5.9.4 and higher, the optional parameter, < invert_y_data >, was added to the TOUCH_SCREEN line of CORTEX.CFG. This parameter allows the user to specify whether or not the Y value from the touchscreen should be inverted. Valid values are: INVERT_Y NO_INVERT If the user does not specify this parameter, the default behavior is to *not* invert the y. Note: This change has only been implemented for the touchscreen with the two-computer version of Cortex. For the other versions of Cortex, this parameter is not used. Additionally, the inversion of the y data will not occur for the simulation of the touchscreen using the mouse. To avoid warning messages at the startup of Cortex, if the invert_y parameter is specified in the cortex.cfg file, then the store_touch_data parameter should be specified as well.
(from the Cortex history.txt file)
Several external variables have been added to the state system to manipulate the touchscreen information. They include TOUCH_x and TOUCH_y (which are in units of 100 * dva, stored as integers), TOUCH_code (a character indicating error or repetition touches), and TOUCH_occurred (an integers indicating whether or not the TOUCH_x and TOUCH_y values are currently valid). At the desired rate (e.g. 20 Hz), CORTEX checks for touches on the touch screen. Then, the state system can poll the TOUCH_??? variables to assess touch-related conditions. The TOUCH_x and TOUCH_y data are stored in the EPP buffer at the rate specified by the Params:General:EPP_storage_rate, provided that put_epp_data_in_buf(ON) was called from the state system first. The CSS function touch_item(test,rel_pos,radius) returns -1 if no touch occurred, 0 if screen was being touched, but not within required radius, and 1 if screen being touched within required radius. Refer to the timing file in the \cortex\demos\touch3 directory for an example. |