Async Social Events
Some stuff is better told to you via the Social event.
Most of the official extensions by YoYo which use this event have an event_type
key in the async_load
.
So I'm using it too.
And that's how I'm going to label them, by the event_type
key's value.
Keys:
-
window
- window index associated with this event. -
new_width
- new width of the window -
new_height
- new height of the window
Happens when the size of the window is changed.
Keys:
-
window
- window index associated with this event.
Happens when either you closed the window, or pressed Alt-F4, or something had asked the window to close itself.
This event usually means that a libmulti_destroy
event will happen on the next frame.
Keys:
-
window
- window index associated with this event.
When you get this event, the window is already gone, it's useless to call any libmulti_
functions with that window.
It only exists to tell you that you shouldn't reference that window anymore.
Keys:
-
window
- window index associated with this event. -
x
- x position of the mouse, relative to your window's client area. -
y
- y position of the mouse, relative to your window's client area.
Happens when the mouse had just entered the window's client area.
Usually after 300ms or so, a libmulti_mousehover
event will occur.
Remember when you hover your mouse over a button, the Tip Text above the button shows only after a second? Well the hover event is that thing.
And this event happens asap.
Keys:
-
window
- window index associated with this event. -
x
- x position of the mouse, relative to your window's client area. -
y
- y position of the mouse, relative to your window's client area.
Happens when Windows thinks your mouse is 'hovering' over a window, it is not the same as libmulti_mouseenter
.
This one happens only after 300 miliseconds or so, depending on your Windows version.
If you're fast enough, you may not get this event at all.
Keys:
-
window
- window index associated with this event.
Happens as soon as the mouse leaves the window's client area.
You can't access the mouse's position here, since it is already outside of the window's bounds.
Feel free to use GameMaker's functions to try to get it, I don't care.
Keys:
-
window
- window index associated with this event. -
contents
- the text as a string, or0
as a number if an error has occurred.
Happens when the user tries to paste some text into a window.
If, for some reason, the clipboard cannot be accessed, contents
will be a number 0
and not a string.
You can use the is_string
function to check if the contents
value is really a string.
libmulti_leftdown/libmulti_leftup/libmulti_rightdown/libmulti_rightup/libmulti_middledown/libmulti_middleup
Keys:
-
window
- window index associated with this event. -
x
- x position of the mouse, relative to your window's client area. -
y
- y position of the mouse, relative to your window's client area.
Analogue of the GameMaker's mouse events.
leftdown - Left Pressed
leftup - Left Released
and so on...
Keys:
-
window
- window index associated with this event. -
character
- raw UTF-16 character code as a number. -
as_string
-character
converted from a UTF-16 character into a UTF-8/GM:S string. -
repeat_count
- see MSDN andWM_CHAR
event in particular. -
scan_code
- see MSDN andWM_CHAR
event in particular. -
is_extended_key
- see MSDN andWM_CHAR
event in particular. -
reserved
- see MSDN andWM_CHAR
event in particular. -
context_code
- see MSDN andWM_CHAR
event in particular. -
previous_state
- see MSDN andWM_CHAR
event in particular. -
transition_state
- see MSDN andWM_CHAR
event in particular.
Happens when the user presses a keyboard key while some libmulti window is active.
Enter key is $0D
(carriage return). You may want to replace that with $0A
(actual newline) when appending to a string.
Backspace is $08
, you may want to simply delete the last character of the string instead of appending that character.
and so on, see the ASCII character table for more info about special characters.