Function Set-Key-Callback

Part of:

package glfw
( set-key-callback < cbfun > )
Parameters
cbfun
Pointer to a callback function that will be called every time a key is pressed or released. The
function should have the following C language prototype:
void GLFWCALL functionname( int key, int action );
Where functionname is the name of the callback function, key is a key identifier, which is an
uppercase printable ISO 8859-1 character or a special key identifier (see table 3.3), and action is
either GLFW_PRESS or GLFW_RELEASE.
If cbfun is NULL, any previously selected callback function will be deselected.
Return values
none
Description
The function selects which function to be called upon a keyboard key event. The callback function is
called every time the state of a single key is changed (from released to pressed or vice versa). The
reported keys are unaffected by any modifiers (such as shift or alt).
A window has to be opened for this function to have any effect.
Notes
Keyboard events are recorded continuously, but only reported when glfwPollEvents, glfwWaitEvents
or glfwSwapBuffers is called.