Click or drag to resize

EventCheckerCheckClickEvent Method

Checks if the mouse click event has happen during the frame.

Namespace:  KSPDev.InputUtils
Assembly:  KSPDev_Utils.2.2 (in KSPDev_Utils.2.2.dll) Version: 2.2 for KSP v1
Syntax
C#
public static bool CheckClickEvent(
	Event ev,
	Nullable<PointerEventDataInputButton> button = null,
	bool onlyCheckModifiers = false
)
Request Example View Source

Parameters

ev
Type: UnityEngineEvent
The event to match for.
button (Optional)
Type: SystemNullablePointerEventDataInputButton
The mouse button from the Unity EventSystem which is known to be pressed in this frame. The EventSystem logic is not in sync with MonoBehaviour.Update, so the event system handlers should provide the pressed button explicitly. The callers from the Update method don't need to do so since the right action button can be extracted from ev.
onlyCheckModifiers (Optional)
Type: SystemBoolean
Tells if only the modifiers in the event need to be checked. This is how a "precondition" can be verified when the GUI is interactive and depends on the pressed keys.

Return Value

Type: Boolean
true if the requested combination has matched the current frame state.
Remarks
This check treats "left" and "right" modifiers equally. And it doesn't consider any of the state modifiers (CAPS, NUM, SCROLL, etc.).
See Also