Hopefully fixed iOS key up/down issue #215

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.
This commit is contained in:
vurtun 2016-08-24 20:37:26 +02:00
parent e69aee6922
commit 114757ffa6
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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;
}