mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 20:18:47 +02:00
Internals: Replace unsigned short with ImWchar when dealing with character storage (missing cases) + in imgui_impl_ file keep using neutral type everywhere, added missing explicit cast in three bindings. (#2078)
This commit is contained in:
@ -97,7 +97,7 @@ void ImGui_ImplFreeGLUT_KeyboardFunc(unsigned char c, int x, int y)
|
||||
//printf("char_down_func %d '%c'\n", c, c);
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
if (c >= 32)
|
||||
io.AddInputCharacter(c);
|
||||
io.AddInputCharacter((unsigned short)c);
|
||||
|
||||
// Store letters in KeysDown[] array as both uppercase and lowercase + Handle GLUT translating CTRL+A..CTRL+Z as 1..26.
|
||||
// This is a hacky mess but GLUT is unable to distinguish e.g. a TAB key from CTRL+I so this is probably the best we can do here.
|
||||
|
@ -188,7 +188,7 @@ bool ImGui_ImplOSX_HandleEvent(NSEvent* event, NSView* view)
|
||||
{
|
||||
int c = [str characterAtIndex:i];
|
||||
if (c < 0xF700 && !io.KeyCtrl)
|
||||
io.AddInputCharacter(c);
|
||||
io.AddInputCharacter((unsigned short)c);
|
||||
|
||||
// We must reset in case we're pressing a sequence of special keys while keeping the command pressed
|
||||
int key = mapCharacterToKey(c);
|
||||
|
Reference in New Issue
Block a user