forked from vurtun/nuklear
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The issue was introduced in the fix for 416 (commit 8559aeb). The original problem was (backspace and arrows moving too fast) is not a nuklear problem but a GLFW problem. Because of the way nuklear handles input (it must be between input_begin and end), the key callback method GLFW offers is not an option. So we have to use glfwGetKey() which returns the current state of a key not whether it was just pressed or released, so nuklear acts like it was pressed every single frame, hence the "too fast" problem. The fix checks for state change and discards the event if there was no change. This kills key repeat behavior (for named keys) on *all* platforms which makes deleting or arrowing inconvenient. Since there's no way to fix the shortcomings of a callback vs event based input API, my "fix" just makes the original fix conditional on a macro NK_KEYSTATE_BASED_INPUT
- Loading branch information
Showing
4 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters