message_flags
Entity: predicate and constant

Usage:
message_flags(Flag)
Flags is message_flags

This predicate is to be used with the messages like key_down, mouse_click, mouse_move and mouse_wheel. With this predicate you can check what was the status of the left, middle and right mouse button and on Ctrl, Alt and Shift buttons on the keyboard at the moment the message was sent.

For mouse buttons the argument Flag has to be:
left, middle or right.

For keyboard buttons it has to be:
shift, alt or ctrl.

For messages key_down and key_up the argument Flag has to be:
function (i.e. functional key)
before (for the previous state of the key - pressed or not)
state (for the transition state of the key)

If you use message_flags as a constant its value will be a number which represents all these flags.

Example:

win_func(mouse_move(X, Y)):-
message_flags(left),
beep.

See also:
Messages

Look at the example:
Fractals.pro (in folder Programs)