-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(lwjgl3): split keyboard input to raw input and text input. Returns MouseDevice#getPosition #24
Conversation
correct compile errors for LibGDXKeyboard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. Seemed to work fine when tested with MovingBlocks/Terasology#3969
Vector2i getPosition(); | ||
|
||
/** | ||
* @return The change in mouse position over the last update | ||
*/ | ||
Vector2i getDelta(); | ||
Vector2d getDelta(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(probably unrelated to this change) Should these getters return the modifiable vectors or the constant interfaces instead?
|
||
/** | ||
* @param button | ||
* @return The current state of the given button | ||
*/ | ||
boolean isButtonDown(int button); | ||
|
||
void update(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this come from? When is it called? Can we add some JavaDoc here, please?
|
||
keyboardActionQueue.add(new KeyboardAction(lastKey, ButtonState.DOWN, character)); | ||
keyboardActionQueue.add(new KeyboardAction(lastKey, ButtonState.UP, character)); | ||
keyboardCharQueue.add(new CharKeyboardAction(character)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What has changed here? Did you we do some kind of key code escaping before which is now obsolete because raw input and char input have been split up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah. KeyUp and KeyDown moved into RawKeyboard.
need some investigate for LibGDX. ( nui v1.0 not used by and LibGDX's game :) )
* Handle raw input events. Raw keys, case-independency, keyboard layout indepencency. | ||
* Use this method for handle actions like "Press X to Win" or "Hold X key to Win" | ||
* If you needs to fill text field, or send chat, use {@link UIWidget#onCharEvent(NUICharEvent)} instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks a lot, these comments help!
Reintegrate changes from lwjgl3 applied to non extracted TeraNui.
See MovingBlocks/Terasology#3969
This PR breaks Mouse and Keyboard interfaces.
update
method (for polling mouse position and calculate delta in LWJGL3 implementation).