Mouse – Giavapps Windows API

api_mouse_check_set_enabled(WindowHandle, Enabled) Enables or disables the mouse check feature for the specified window. This feature is disabled by default. PLEASE NOTE: you should call mouse_check_* built-in functions for the GameMaker: Studio window since it usually runs in a different Window Procedure (unless you called api_window_set_giavapps_procedure()).

WindowHandle: it must be a WindowHandle.
Enabled: enables (true) or disables (false) the keyboard check feature.

 

api_mouse_check_get_enabled(WindowHandle) Returns true if the mouse check feature is enabled for the specified window or false otherwise.

WindowHandle: it must be a WindowHandle.

 

api_mouse_check_button(WindowHandle, MouseButton) Returns true if the mouse button being checked is held down or false if it is not. This function is compatible with mb_* constants of GameMaker: Studio.

WindowHandle: it must be a WindowHandle.
MouseButton: which mouse button constant to check for.

 

api_mouse_check_button_pressed(WindowHandle, MouseButton) Returns true if the mouse button being checked has been pressed or false if it has not. This function is compatible with mb_* constants of GameMaker: Studio.

WindowHandle: it must be a WindowHandle.
MouseButton: which mouse button constant to check for.

 

api_mouse_check_button_double_pressed(WindowHandle, MouseButton) Returns true if the mouse button being checked has been double pressed or false if it has not. This function is compatible with mb_* constants of GameMaker: Studio.

WindowHandle: it must be a WindowHandle.
MouseButton: which mouse button constant to check for.

 

api_mouse_check_button_released(WindowHandle, MouseButton) Returns true if the mouse button being checked has been released or false if it has not. This function is compatible with mb_* constants of GameMaker: Studio.

WindowHandle: it must be a WindowHandle.
MouseButton: which mouse button constant to check for.

 

api_mouse_check_wheel_up(WindowHandle) Returns true if the mouse wheel is being rotated upwards or false otherwise.

WindowHandle: it must be a WindowHandle.

 

api_mouse_check_wheel_down(WindowHandle) Returns false if the mouse wheel is being rotated downwards or false otherwise.

WindowHandle: it must be a WindowHandle.

 

api_mouse_button_press(WindowHandle, MouseButton) Simulates (internally) the press of any button on the mouse. This function is compatible with mb_* constants of GameMaker: Studio. If MouseButton argument is mb_any Giavapps Windows API simulates (internally) the press of all the buttons on the mouse.

WindowHandle: it must be a WindowHandle.
MouseButton: which mouse button constant to check for.

 

api_mouse_button_release(WindowHandle, MouseButton) Simulates (internally) the release of any button on the mouse. This function is compatible with mb_* constants of GameMaker: Studio. If MouseButton argument is mb_any Giavapps Windows API simulates (internally) the release of all the buttons on the mouse.

WindowHandle: it must be a WindowHandle.
MouseButton: which mouse button constant to check for.

 

api_mouse_wheel_up(WindowHandle) Simulates (internally) an upward rotation of the mouse wheel.

WindowHandle: it must be a WindowHandle.

 

api_mouse_wheel_down(WindowHandle) Simulates (internally) a downward rotation of the mouse wheel.

WindowHandle: it must be a WindowHandle.

 

api_mouse_clear(WindowHandle) Clears (internally) all states of the mouse for the specified window.

 

api_mouse_button_press_direct(MouseButton) Simulates (hardware) the press of any button on the mouse. This function is compatible with mb_* constants of GameMaker: Studio.

MouseButton: which mouse button constant to check for.

 

api_mouse_button_release_direct(MouseButton) Simulates (hardware) the release of any button on the mouse. This function is compatible with mb_* constants of GameMaker: Studio.

MouseButton: which mouse button constant to check for.

 

api_mouse_wheel_up_direct() Simulates (hardware) the upward rotation of the mouse wheel.

 

api_mouse_wheel_down_direct() Simulates (hardware) the downward rotation of the mouse wheel.

 

Code Examples

 

Enabling the Mouse Check Feature

 

api_mouse_check_set_enabled(window1,1);
api_mouse_check_set_enabled(window2,1);

 

Checking Mouse Button Presses In Different Windows

 

//WINDOW 1
if(api_mouse_check_button_pressed(window1,mb_left))
{
api_messagebox(window1,"LEFT MOUSE BUTTON PRESSED IN WINDOW 1!","PRESSED!",MB_OK);
}

//WINDOW 2
if(api_mouse_check_button_pressed(window2,mb_left))
{
api_messagebox(window2,"LEFT MOUSE BUTTON PRESSED IN WINDOW 2!","PRESSED!",MB_OK);
}

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*