Skip to content

Commit

Permalink
Hopefully fixed iOS key up/down issue vurtun#215
Browse files Browse the repository at this point in the history
SDL iOs implementation provides key press and release in
one frame and while nuklear previously was keeping track
of transistions it did not check it. It hopefully should now be
possible to correctly interpret up and down key in the same frame.
  • Loading branch information
vurtun committed Aug 24, 2016
1 parent e69aee6 commit 114757f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

- 2016/08/15 (1.10) - Changed `nk_input_is_key_pressed` and 'nk_input_is_key_released'
to account for key press and release happening in one frame.
- 2016/08/15 (1.10) - Added additional nk_edit flag to directly jump to the end on activate
- 2016/08/15 (1.096)- Removed invalid check for value zero in nk_propertyx
- 2016/08/15 (1.095)- Fixed ROM mode for deeper levels of popup windows parents.
- 2016/08/15 (1.094)- Editbox are now still active if enter was pressed with flag
Expand Down
4 changes: 2 additions & 2 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -10446,7 +10446,7 @@ nk_input_is_key_pressed(const struct nk_input *i, enum nk_keys key)
const struct nk_key *k;
if (!i) return nk_false;
k = &i->keyboard.keys[key];
if (k->down && k->clicked)
if ((k->down && k->clicked) || (!k->down && k->clicked >= 2))
return nk_true;
return nk_false;
}
Expand All @@ -10457,7 +10457,7 @@ nk_input_is_key_released(const struct nk_input *i, enum nk_keys key)
const struct nk_key *k;
if (!i) return nk_false;
k = &i->keyboard.keys[key];
if (!k->down && k->clicked)
if ((!k->down && k->clicked) || (k->down && k->clicked >= 2))
return nk_true;
return nk_false;
}
Expand Down

0 comments on commit 114757f

Please sign in to comment.