Supported Browsers Home   
GM_setGameLogicFunc Previous   
GM_setKeyRepeatFunc Next   
External Functions Up   

GM_setKeyDownFunc

Sets the key down callback function

Declaration

void MGLAPI GM_setKeyDownFunc(
    GM_keyDownFunc func)
typedef void (*GM_keyDownFunc)(
    event_t *evt)

Prototype In

gm/gm.h

Parameters

func

Key down callback function to register

 

Description

This function sets the key down callback function for your Game Framework game and is called by the Game Framework main loop (GM_mainLoop) multiple times per frame to process all key down events in the order that they are entered by the user. Note that your callback is passed a copy of the event that needs to be processed, so you can if you wish have a single handler for all key events, or one that handles both key down and key repeat events and register the same function with the Game Framework for both event types.

Note:    The key down callback will not be called for key repeat events (ie: the user holds a key down). If you wish to capture key repeat events, use GM_setKeyRepeatFunc.

See Also

GM_init, GM_setKeyRepeatFunc, GM_setKeyUpFunc

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com