From f95b815040c0e119b7f43c68bfad9466d2e006c4 Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sat, 26 Nov 2022 12:59:55 +0100 Subject: [PATCH] doc: document restrictions for BindButtonEvent (#5079) While working on Terasology/FlexiblePathfinding#8 we noticed that there seem to be issues with sending events extending from BindButtonEvent programmatically (without the physical button press). To avoid any future confusion (or at least find the issue sooner) I'm adding a brief docstring to the class stating it's intended use and that one should NOT use it directly. --- .../org/terasology/engine/input/BindButtonEvent.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/engine/src/main/java/org/terasology/engine/input/BindButtonEvent.java b/engine/src/main/java/org/terasology/engine/input/BindButtonEvent.java index 91ccde6b5dd..564e6c7a137 100644 --- a/engine/src/main/java/org/terasology/engine/input/BindButtonEvent.java +++ b/engine/src/main/java/org/terasology/engine/input/BindButtonEvent.java @@ -1,4 +1,4 @@ -// Copyright 2021 The Terasology Foundation +// Copyright 2022 The Terasology Foundation // SPDX-License-Identifier: Apache-2.0 package org.terasology.engine.input; @@ -7,6 +7,15 @@ import org.terasology.engine.input.events.ButtonEvent; import org.terasology.input.ButtonState; +/** + * An event triggered by auto-registered (physical) buttons when they are pressed. + *

+ * To be used in combination with {@link RegisterBindButton} and {@link DefaultBinding}. + *

+ * Classes extending this usually follow the naming pattern {@code <Name>Button}. + *

+ * NOTE: DO NOT USE DIRECTLY! + */ public class BindButtonEvent extends ButtonEvent { private SimpleUri id;