diff --git a/CHANGELOG.md b/CHANGELOG.md index ccea9c7..9de1e0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/nuklear.h b/nuklear.h index 730cfba..6b70cc2 100644 --- a/nuklear.h +++ b/nuklear.h @@ -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; } @@ -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; }