GUI: work around Android backspace issue
This commit is contained in:
parent
a4fe7ddb76
commit
ce08a62548
|
|
@ -244,6 +244,14 @@ void FurnaceGUI::drawMobileControls() {
|
||||||
mobileMenuOpen=false;
|
mobileMenuOpen=false;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Log")) {
|
||||||
|
logOpen=!logOpen;
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Debug")) {
|
||||||
|
debugOpen=!debugOpen;
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("About")) {
|
if (ImGui::Button("About")) {
|
||||||
mobileMenuOpen=false;
|
mobileMenuOpen=false;
|
||||||
mobileMenuPos=0.0f;
|
mobileMenuPos=0.0f;
|
||||||
|
|
|
||||||
|
|
@ -2977,6 +2977,10 @@ bool FurnaceGUI::loop() {
|
||||||
}
|
}
|
||||||
eventTimeBegin=SDL_GetPerformanceCounter();
|
eventTimeBegin=SDL_GetPerformanceCounter();
|
||||||
bool updateWindow=false;
|
bool updateWindow=false;
|
||||||
|
if (injectBackUp) {
|
||||||
|
ImGui::GetIO().AddKeyEvent(ImGuiKey_Backspace,false);
|
||||||
|
injectBackUp=false;
|
||||||
|
}
|
||||||
while (SDL_PollEvent(&ev)) {
|
while (SDL_PollEvent(&ev)) {
|
||||||
WAKE_UP;
|
WAKE_UP;
|
||||||
ImGui_ImplSDL2_ProcessEvent(&ev);
|
ImGui_ImplSDL2_ProcessEvent(&ev);
|
||||||
|
|
@ -3039,6 +3043,9 @@ bool FurnaceGUI::loop() {
|
||||||
if (!ImGui::GetIO().WantCaptureKeyboard) {
|
if (!ImGui::GetIO().WantCaptureKeyboard) {
|
||||||
keyDown(ev);
|
keyDown(ev);
|
||||||
}
|
}
|
||||||
|
#ifdef IS_MOBILE
|
||||||
|
injectBackUp=true;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
// for now
|
// for now
|
||||||
|
|
@ -3738,6 +3745,10 @@ bool FurnaceGUI::loop() {
|
||||||
drawPiano();
|
drawPiano();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
globalWinFlags=0;
|
||||||
|
drawDebug();
|
||||||
|
drawLog();
|
||||||
} else {
|
} else {
|
||||||
globalWinFlags=0;
|
globalWinFlags=0;
|
||||||
ImGui::DockSpaceOverViewport(NULL,lockLayout?(ImGuiDockNodeFlags_NoWindowMenuButton|ImGuiDockNodeFlags_NoMove|ImGuiDockNodeFlags_NoResize|ImGuiDockNodeFlags_NoCloseButton|ImGuiDockNodeFlags_NoDocking|ImGuiDockNodeFlags_NoDockingSplitMe|ImGuiDockNodeFlags_NoDockingSplitOther):0);
|
ImGui::DockSpaceOverViewport(NULL,lockLayout?(ImGuiDockNodeFlags_NoWindowMenuButton|ImGuiDockNodeFlags_NoMove|ImGuiDockNodeFlags_NoResize|ImGuiDockNodeFlags_NoCloseButton|ImGuiDockNodeFlags_NoDocking|ImGuiDockNodeFlags_NoDockingSplitMe|ImGuiDockNodeFlags_NoDockingSplitOther):0);
|
||||||
|
|
@ -5441,6 +5452,7 @@ FurnaceGUI::FurnaceGUI():
|
||||||
vgmExportPatternHints(false),
|
vgmExportPatternHints(false),
|
||||||
vgmExportDirectStream(false),
|
vgmExportDirectStream(false),
|
||||||
portrait(false),
|
portrait(false),
|
||||||
|
injectBackUp(false),
|
||||||
mobileMenuOpen(false),
|
mobileMenuOpen(false),
|
||||||
wantCaptureKeyboard(false),
|
wantCaptureKeyboard(false),
|
||||||
oldWantCaptureKeyboard(false),
|
oldWantCaptureKeyboard(false),
|
||||||
|
|
|
||||||
|
|
@ -1036,7 +1036,7 @@ class FurnaceGUI {
|
||||||
|
|
||||||
bool quit, warnQuit, willCommit, edit, modified, displayError, displayExporting, vgmExportLoop, zsmExportLoop, vgmExportPatternHints;
|
bool quit, warnQuit, willCommit, edit, modified, displayError, displayExporting, vgmExportLoop, zsmExportLoop, vgmExportPatternHints;
|
||||||
bool vgmExportDirectStream;
|
bool vgmExportDirectStream;
|
||||||
bool portrait, mobileMenuOpen;
|
bool portrait, injectBackUp, mobileMenuOpen;
|
||||||
bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu;
|
bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu;
|
||||||
bool displayNew, fullScreen, preserveChanPos, wantScrollList, noteInputPoly;
|
bool displayNew, fullScreen, preserveChanPos, wantScrollList, noteInputPoly;
|
||||||
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex;
|
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex;
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,13 @@ void reportError(String what) {
|
||||||
logE("%s",what);
|
logE("%s",what);
|
||||||
MessageBox(NULL,what.c_str(),"Furnace",MB_OK|MB_ICONERROR);
|
MessageBox(NULL,what.c_str(),"Furnace",MB_OK|MB_ICONERROR);
|
||||||
}
|
}
|
||||||
|
#elif defined(ANDROID)
|
||||||
|
void reportError(String what) {
|
||||||
|
logE("%s",what);
|
||||||
|
#ifdef HAVE_SDL2
|
||||||
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,"Error",what.c_str(),NULL);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
void reportError(String what) {
|
void reportError(String what) {
|
||||||
logE("%s",what);
|
logE("%s",what);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue