Merge pull request #64 from generalzzd/zzd

fix: UTF-8 Backspace now works as expected in SFML OpenGL 3 Demo
This commit is contained in:
dumblob 2020-02-27 08:54:31 +01:00 committed by GitHub
commit e4d90b7db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -442,7 +442,10 @@ nk_sfml_handle_event(sf::Event* evt)
} else nk_input_motion(ctx, evt->touch.x, evt->touch.y);
return 1;
} else if(evt->type == sf::Event::TextEntered) {
nk_input_unicode(ctx, evt->text.unicode);
/* 8 ~ backspace */
if (evt->text.unicode != 8) {
nk_input_unicode(ctx, evt->text.unicode);
}
return 1;
} else if(evt->type == sf::Event::MouseWheelScrolled) {
nk_input_scroll(ctx, nk_vec2(0,evt->mouseWheelScroll.delta));