The trigger_key_event function directly triggers a key event.
Syntax
ERR trigger_key_event(ID32 event_id, UINT32 value)
The trigger_key_event function has these parameters:
Parameter | Description |
ID32 event_id | Specifies the event to trigger. See the topic Event IDs for a complete list of events. |
UINT32 value | Specifies the value used by the event. This parameter depends on the event specified in the event_id parameter. |
Return Values
The trigger_key_event function has these return values:
Return Value | Description |
0 | Returns 0 if the event was valid and triggered successfully. |
Non-zero | Returns a non-zero number if there is an error. |
Example
BOOL throttle_cb(PPIXPOINT relative_point, FLAGS32 mouse_flags)
{
SINT32 new_val;
new_val = background.image_data.final->dim.y - relative_point->y;
new_val = (UINT32)((FLOAT64)(new_val*16383) /
background.image_data.final->dim.y);
if(new_val > 16383)
new_val = 16383;
if(new_val < 0)
new_val = 0;
trigger_key_event(KEY_THROTTLE_SET, new_val);
return FALSE;
}