Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emscripten fix #116

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BaseEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ namespace ofxImGui
//--------------------------------------------------------------
void BaseEngine::onKeyPressed(ofKeyEventArgs& event)
{
int key = event.keycode;
int key = event.key;
ImGuiIO& io = ImGui::GetIO();
io.KeysDown[key] = true;
//io->AddInputCharacter((unsigned short)event.codepoint);
io.AddInputCharacter((unsigned short)event.key);
}

//--------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions src/EngineOpenGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,9 @@ namespace ofxImGui
//--------------------------------------------------------------
void EngineOpenGLES::onKeyReleased(ofKeyEventArgs& event)
{
int key = event.keycode;
int key = event.key;
ImGuiIO& io = ImGui::GetIO();
io.KeysDown[key] = false;
io.AddInputCharacter((unsigned short)event.codepoint);
//TODO modifiers?
}
}

Expand Down
1 change: 1 addition & 0 deletions src/ImHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "ofTexture.h"
#include "ofGLBaseTypes.h"
#include "imgui.h"
#include "stack"

static const int kImGuiMargin = 10;

Expand Down