GSDP:GAM100/CProcessing/MouseInputCallbackFunction

From Inside
Jump to: navigation, search

MouseInputCallbackFunction

Description

The type used to define a callback function that can be set to be called every time the state of a mouse button changes. When making the function, it must have the parameters MouseButton and KeyState.

Example

// Note the parameters as these must be here in that order
void MyMouseCallback(MouseButton button, KeyState state)
{
    switch(button)
    {
        case MOUSE_BUTTON_LEFT :
            if(state == KeyRepeat)
                Aim();
            break;
        case MOUSE_BUTTON_RIGHT :
            if(state == KeyPressed)
                Shoot();
            break;
    }
}

void Init()
{
    // Sets it so every time a mouse button changes
    // state your callback function is called
    setMouseInputCallback(MyMouseCallback);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>