SR Research Support Site
Functions
miscellaneous functions

Functions

void get_display_information (DISPLAYINFO *di)
 
INT16 sdl_init_expt_graphics ()
 
void sdl_close_expt_graphics ()
 
INT16 get_input_key (InputEvent *key_input)
 
int writeImage (char *outfilename, IMAGETYPE format, EYEBITMAP *bitmap)
 

Detailed Description

Function Documentation

void get_display_information ( DISPLAYINFO di)

This is an optional function to get information on video driver and current mode use this to determine if in proper mode for experiment.

Parameters
[out]diA valid pointer to DISPLAYINFO is passed in to return values.
Remarks
The prototype of this function can be changed to match one's need or if it is not necessary, one can choose not to implement this function also.
INT16 get_input_key ( InputEvent key_input)

This is called to check for keyboard input. In this function:

  • check if there are any input events
  • if there are input events, fill key_input and return 1. otherwise return 0. If 1 is returned this will be called again to check for more events.
Parameters
[out]key_inputfill in the InputEvent structure to return key,modifier values.
Returns
if there is a key, return 1 otherwise return 0.
Remarks
Special keys and modifiers should match the following code

Special keys:

1 #define F1_KEY 0x3B00
2 #define F2_KEY 0x3C00
3 #define F3_KEY 0x3D00
4 #define F4_KEY 0x3E00
5 #define F5_KEY 0x3F00
6 #define F6_KEY 0x4000
7 #define F7_KEY 0x4100
8 #define F8_KEY 0x4200
9 #define F9_KEY 0x4300
10 #define F10_KEY 0x4400
11 
12 #define PAGE_UP 0x4900
13 #define PAGE_DOWN 0x5100
14 #define CURS_UP 0x4800
15 #define CURS_DOWN 0x5000
16 #define CURS_LEFT 0x4B00
17 #define CURS_RIGHT 0x4D00
18 
19 #define ESC_KEY 0x001B
20 #define ENTER_KEY 0x000D

Modifier: If you are using SDL you do not need to modify the modifier value as they match the value.

1 #define ELKMOD_NONE 0x0000
2 #define ELKMOD_LSHIFT 0x0001
3 #define ELKMOD_RSHIFT 0x0002
4 #define ELKMOD_LCTRL 0x0040
5 #define ELKMOD_RCTRL 0x0080
6 #define ELKMOD_LALT 0x0100
7 #define ELKMOD_RALT 0x0200
8 #define ELKMOD_LMETA 0x0400
9 #define ELKMOD_RMETA 0x0800,
10 #define ELKMOD_NUM 0x1000
11 #define ELKMOD_CAPS 0x2000
12 #define ELKMOD_MODE 0x4000
void sdl_close_expt_graphics ( )

This is an optional function to properly close and release any resources that are not required beyond calibration needs.

Remarks
the prototype of this function can be modified to suit ones need.
INT16 sdl_init_expt_graphics ( )

This is an optional function to initialize graphics and calibration system. Although, this is optional, one should do the innerds of this function elsewhere in a proper manner.

Remarks
The prototype of this function can be modified to suit ones needs. Eg. The init_expt_graphics of eyelink_core_graphics.dll takes in 2 parameters.
int writeImage ( char *  outfilename,
IMAGETYPE  format,
EYEBITMAP bitmap 
)

This function provides support to writing images to disk. Upon calls to el_bitmap_save_and_backdrop or el_bitmap_save this function is requested to do the write operation in the preferred format.

Parameters
[in]outfilenameName of the file to be saved.
[in]formatformat to be saved as.
[in]bitmapbitmap data to be saved.
Returns
if successful, return 0.

Copyright ©2002-2023, SR Research Ltd.