Skip to content

Commit

Permalink
Fix wchar_t type on 605599b
Browse files Browse the repository at this point in the history
event.KeyInput.Char is a wchar_t, iswprint should be used
  • Loading branch information
nerzhul committed May 20, 2017
1 parent 60baf81 commit a2bb776
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/guiChatConsole.cpp
Expand Up @@ -627,9 +627,7 @@ bool GUIChatConsole::OnEvent(const SEvent& event)
bool backwards = event.KeyInput.Shift;
prompt.nickCompletion(names, backwards);
return true;
}
else if(isprint(event.KeyInput.Char) && !event.KeyInput.Control)
{
} else if (iswprint(event.KeyInput.Char) && !event.KeyInput.Control) {
#if defined(__linux__) && (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 9)
wchar_t wc = L'_';
mbtowc( &wc, (char *) &event.KeyInput.Char, sizeof(event.KeyInput.Char) );
Expand Down

1 comment on commit a2bb776

@Fixer-007
Copy link
Contributor

@Fixer-007 Fixer-007 commented on a2bb776 May 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes regression, interestingly I found just one special symbol on keyboard, that is not working anymore: U+2116 № (Numero Sign). Not a big deal, since it is very rarely used in minetest.

Please sign in to comment.