Add InputEvent documentation (#5698)

This commit is contained in:
Antoine Lucas 2019-07-09 04:47:06 +02:00 committed by LexManos
parent d41fad51c2
commit 650e7dc16e

View file

@ -27,7 +27,7 @@ import org.lwjgl.glfw.GLFW;
public class InputEvent extends Event public class InputEvent extends Event
{ {
/** /**
* This event fires when a mouse button is pressed. * This event fires when a mouse input is detected.
*/ */
public static class MouseInputEvent extends InputEvent public static class MouseInputEvent extends InputEvent
{ {
@ -41,16 +41,37 @@ public class InputEvent extends Event
this.mods = mods; this.mods = mods;
} }
/**
* The mouse button that triggered this event.
* https://www.glfw.org/docs/latest/group__buttons.html
*
* @see GLFW mouse constants starting with "GLFW_MOUSE_BUTTON_"
*/
public int getButton() public int getButton()
{ {
return this.button; return this.button;
} }
/**
* Integer representing the mouse button's action.
*
* @see GLFW#GLFW_PRESS
* @see GLFW#GLFW_RELEASE
*/
public int getAction() public int getAction()
{ {
return this.action; return this.action;
} }
/**
* Bit field representing the modifier keys pressed.
* https://www.glfw.org/docs/latest/group__mods.html
*
* @see GLFW#GLFW_MOD_SHIFT
* @see GLFW#GLFW_MOD_CONTROL
* @see GLFW#GLFW_MOD_ALT
* @see GLFW#GLFW_MOD_SUPER
*/
public int getMods() public int getMods()
{ {
return this.mods; return this.mods;
@ -58,7 +79,7 @@ public class InputEvent extends Event
} }
/** /**
* This event fires when keyboard input is detected. * This event fires when a keyboard input is detected.
*/ */
public static class KeyInputEvent extends InputEvent public static class KeyInputEvent extends InputEvent
{ {
@ -75,7 +96,7 @@ public class InputEvent extends Event
} }
/** /**
* The keyboard key that was pressed or released * The keyboard key that triggered this event.
* https://www.glfw.org/docs/latest/group__keys.html * https://www.glfw.org/docs/latest/group__keys.html
* *
* @see GLFW key constants starting with "GLFW_KEY_" * @see GLFW key constants starting with "GLFW_KEY_"
@ -98,6 +119,13 @@ public class InputEvent extends Event
return this.scanCode; return this.scanCode;
} }
/**
* Integer representing the key's action.
*
* @see GLFW#GLFW_PRESS
* @see GLFW#GLFW_RELEASE
* @see GLFW#GLFW_REPEAT
*/
public int getAction() public int getAction()
{ {
return this.action; return this.action;
@ -105,6 +133,7 @@ public class InputEvent extends Event
/** /**
* Bit field representing the modifier keys pressed. * Bit field representing the modifier keys pressed.
* https://www.glfw.org/docs/latest/group__mods.html
* *
* @see GLFW#GLFW_MOD_SHIFT * @see GLFW#GLFW_MOD_SHIFT
* @see GLFW#GLFW_MOD_CONTROL * @see GLFW#GLFW_MOD_CONTROL