Mouse devices may be convenient for experiments since they have simple buttons that make them saver than keyboards. However, they suffer from the same timing problems as keyboards. The PXL software automatically detects the number of buttons and uses the buttons in the same way as switchboards are used. Note that mouse usage requires that a mouse device driver is installed. Mouse drivers are able to generate interrupts and some PXL programs are able to use interrupt driven response keys. Usually these have to activated by a flag and are not used by default. In order to get stable timing with mouse buttons one has to make sure that no mouse movements occur while the programs is waiting for a response. Thus either the mouse is fixed or the mouse ball should be removed.
All response events are numbered. The switch numbering is bitwise and it is defined by the entries of the array switchnumbers. The default for switchnumbers depends on the device type. For game port switches the default is switchnumbers = [0, 0, 0, 0, 1, 2, 3, 4]
Note that bits 0 to 3 are not used with game port switches since the single switches are connected to bits 4 to 7 of the game input port. For printer port switches the default is.
Mouse event numbers are switchnumbers = [1, 2, 3] depending on the number of buttons available. The event numbers for keyboard input are identical to the key's scan code combined with the extended ASCII code for the respective key. The test program event.exe may be used to find out the event numbers of any response device.
Many experiments use yes/no responses. In this case the parameters yeskey, nokey, and stopkey offer a simple way to define which switch number corresponds to the respective response. Simply define the parameter value to be the switch number of the corresponding response event. The default values for these keys in case of keyboard input are ok.
Response switches usually have special patterns which are related to special meanings for experimental programs. An example is a program for adjusting some stimulus intensity. Such a program needs at least 3 keys: one for up, one for down, and one to indicate that the adjustment is finished. These keys are selected by binary patterns which are used to mask off certain bits of the input ports.
All the parameters for an input switch board are stored in the array switchmask. The list of definitions in Table swmask shows the meaning of the different entries of switchmask. The array switchmask may be redefined in parameter files. The following example defines the patterns for an 8-bit parallel input port at port address 0x104(= 260) with initialization port address at 0x107 (=263):
Note that the parameter switchtype is not affected by changing switchmask. In fact, the default values of switchmask are those belonging to the built in mask values for switchtype. One may change only selected entries of switchmask by inserting only those entries which have to be changed. All the entries which are not to be changed have to be set to -1.
Mouse devices may be convenient for experiments since they have simple buttons that make them saver than keyboards. However, they suffer from the same timing problems as keyboards. The PXL software automatically detects the number of buttons and uses the buttons in the same way as switchboards are used. Note that mouse usage requires that a mouse device driver is installed. Mouse drivers are able to generate interrupts and some PXL programs are able to use interrupt driven response keys. Usually these have to activated by a flag and are not used by default. In order to get stable timing with mouse buttons one has to make sure that no mouse movements occur while the programs is waiting for a response. Thus either the mouse is fixed or the mouse ball should be removed.
All response events are numbered. The switch numbering is bitwise and it is defined by the entries of the array switchnumbers. The default for switchnumbers depends on the device type. For game port switches the default is switchnumbers = [0, 0, 0, 0, 1, 2, 3, 4]
Note that bits 0 to 3 are not used with game port switches since the single switches are connected to bits 4 to 7 of the game input port. For printer port switches the default is.
Mouse event numbers are switchnumbers = [1, 2, 3] depending on the number of buttons available. The event numbers for keyboard input are identical to the key's scan code combined with the extended ASCII code for the respective key. The test program event.exe may be used to find out the event numbers of any response device.
Many experiments use yes/no responses. In this case the parameters yeskey, nokey, and stopkey offer a simple way to define which switch number corresponds to the respective response. Simply define the parameter value to be the switch number of the corresponding response event. The default values for these keys in case of keyboard input are ok.
The PXL programs use milliseconds as their unit for timing parameters. The time is derived from the hardware and software timer available in IBM PC/AT computers. Precision of timing is around 1 millisecond on these systems. The IBM PC timing software is extremely hardware dependent and works only on true “compatibles”. The system time on these machines is derived from a hardware counter whose input frequency is 1.19318 MHz. This frequency is constant across all IBM PC compatible computers and independent of system bus timing and of processor clock speed. The PXL timing software is optimized for speed by using only integer arithmetic.
No hardware floating point processor is used by the timing functions. One consequence of this is that timing is not correct across midnight. Thus it is better not to run experiments that try to measure the time between two events such that the system time crosses midnight in between the two events. If this seems to be an absolute necessity for someone, a simple solution is to use a wrong time of day value. Simply set the time of day such that the midnight overflow does not happen during the experimental run. Section ttcheck describes the test program ttcheck which may be used to test the proper working of PXL's basic timing functions.