t2:mousemapping

mousemapping


mousemapping — Configure mouse mapping

Description


bool mousemapping(const uint8 map[]);
bool mousemapping();

Configure the mouse mapping according with map[] parameter or call keymapping() without parameter to disable the default mapping. Once the mouse mapping is configured, it remains active until the memory slot is unloaded or mousemapping_reset() is called.

The function mousemapping() is equivalent to a Mouse Mapping created using the Input Translator interface on Gtuner IV.

Parameters


  • map[]: Constant array of a variable number of mapping pairs that defines an mouse mapping.

Return Value


Returns true if the mouse mapping was successfully loaded, or FALSE if the mouse mapping failed to load.

mousemapping() fails to load an new mapping if there is an Input Translator with Mouse Mapping already loaded by the user.

Examples


Example #1 mousemapping() example

#include <mouse.gph>
 
init {
    // Load an Mouse Mapping to reproduce the default BF1 layout
    const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X, 
        MOUSE_Y,            STICK_1_Y, 
        MWHEEL_FORWARD,     BUTTON_14, 
        MWHEEL_BACKWARD,    BUTTON_14, 
        MBUTTON_1,          BUTTON_5,
        MBUTTON_2,          BUTTON_8,
    };
    mousemapping(mmap);
}

See Also

t2/mousemapping.txt · Last modified: 2020/04/21 06:26 by J2Kbr