From af29d3e7efcb9733687a6a3aaa9df580b6dcb0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 12 Jan 2020 14:56:40 -0300 Subject: [PATCH] Added support for on screen keyboard on Windows. --HG-- branch : dev --- include/eepp/system/virtualfilesystem.hpp | 1 + include/eepp/window/window.hpp | 23 +++- premake4.lua | 5 +- premake5.lua | 4 +- projects/windows/ee.config | 1 - projects/windows/ee.files | 35 ++++- src/eepp/ui/uitextinput.cpp | 3 + src/eepp/window/backend/SDL2/windowsdl2.cpp | 135 +++++++++++++++++++- src/eepp/window/backend/SDL2/wminfo.cpp | 5 +- src/eepp/window/backend/SDL2/wminfo.hpp | 2 +- src/eepp/window/engine.cpp | 5 +- src/examples/empty_window/empty_window.cpp | 4 - 12 files changed, 189 insertions(+), 34 deletions(-) diff --git a/include/eepp/system/virtualfilesystem.hpp b/include/eepp/system/virtualfilesystem.hpp index 613088295..f7b4f7b89 100644 --- a/include/eepp/system/virtualfilesystem.hpp +++ b/include/eepp/system/virtualfilesystem.hpp @@ -1,6 +1,7 @@ #ifndef EE_VIRTUALFILESYSTEM_HPP #define EE_VIRTUALFILESYSTEM_HPP +#include #include #include #include diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 5fa9914b0..4f774dc3a 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -37,14 +37,22 @@ namespace WindowBackend { enum { SDL2, Default }; } +#ifndef EE_SCREEN_KEYBOARD_ENABLED +#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS +#define EE_SCREEN_KEYBOARD_ENABLED true +#else +#define EE_SCREEN_KEYBOARD_ENABLED false +#endif +#endif + /** @brief WindowSettings A small class that contains the window settings */ class WindowSettings { public: inline WindowSettings( Uint32 width, Uint32 height, const std::string& caption = std::string(), Uint32 style = WindowStyle::Default, Uint32 backend = WindowBackend::Default, Uint32 bpp = 32, - const std::string& icon = std::string(), - const Float& pixelDensity = 1 ) : + const std::string& icon = std::string(), const Float& pixelDensity = 1, + const bool& useScreenKeyboard = EE_SCREEN_KEYBOARD_ENABLED ) : Style( style ), Width( width ), Height( height ), @@ -52,7 +60,8 @@ class WindowSettings { Icon( icon ), Caption( caption ), Backend( backend ), - PixelDensity( pixelDensity ) {} + PixelDensity( pixelDensity ), + UseScreenKeyboard( useScreenKeyboard ) {} inline WindowSettings() : Style( WindowStyle::Default ), @@ -60,7 +69,8 @@ class WindowSettings { Height( 600 ), BitsPerPixel( 32 ), Backend( WindowBackend::Default ), - PixelDensity( 1 ) {} + PixelDensity( 1 ), + UseScreenKeyboard( EE_SCREEN_KEYBOARD_ENABLED ) {} Uint32 Style; Uint32 Width; @@ -70,6 +80,7 @@ class WindowSettings { std::string Caption; Uint32 Backend; Float PixelDensity; + bool UseScreenKeyboard; }; /** @brief ContextSettings Small class that contains the renderer context information */ @@ -405,8 +416,8 @@ class EE_API Window { virtual bool isScreenKeyboardShown(); /** @return True if the current window support a threaded GL Context. This means that supports - *OpenGL Shared Contexts ( multithreaded opengl contexts ). * Only supported with SDL2 - *backend.*/ + *OpenGL Shared Contexts ( multithreaded opengl contexts ). * Only supported with SDL2 + *backend.*/ virtual bool isThreadedGLContext(); /** Activates the shared GL context in the current thread. */ diff --git a/premake4.lua b/premake4.lua index ea172dfe5..21e74e4a9 100644 --- a/premake4.lua +++ b/premake4.lua @@ -465,9 +465,9 @@ function generate_os_links() table.insert( os_links, "dl" ) end elseif os.is_real("windows") then - multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm" } ) + multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm", "ole32" } ) elseif os.is_real("mingw32") then - multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm" } ) + multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm", "ole32" } ) elseif os.is_real("macosx") then multiple_insert( os_links, { "OpenGL.framework", "OpenAL.framework", "CoreFoundation.framework" } ) elseif os.is_real("freebsd") then @@ -916,6 +916,7 @@ solution "eepp" project "eepp-ew" set_kind() language "C++" + links { "ole32" } files { "src/examples/empty_window/*.cpp" } build_link_configuration( "eeew", true ) diff --git a/premake5.lua b/premake5.lua index bf1a10238..4ee1ccfe2 100644 --- a/premake5.lua +++ b/premake5.lua @@ -302,9 +302,9 @@ function generate_os_links() table.insert( os_links, "dl" ) end elseif os.istarget("windows") then - multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm" } ) + multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm", "ole32" } ) elseif os.istarget("mingw32") then - multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm" } ) + multiple_insert( os_links, { "OpenAL32", "opengl32", "glu32", "gdi32", "ws2_32", "winmm", "ole32" } ) elseif os.istarget("macosx") then multiple_insert( os_links, { "OpenGL.framework", "OpenAL.framework", "CoreFoundation.framework" } ) elseif os.istarget("freebsd") then diff --git a/projects/windows/ee.config b/projects/windows/ee.config index 9358a2eb0..f5601b61b 100644 --- a/projects/windows/ee.config +++ b/projects/windows/ee.config @@ -1,5 +1,4 @@ #define EE_SDL_VERSION_2 -#define EE_X11_PLATFORM #define EE_DEBUG #define EE_MEMORY_MANAGER #define EE_SHADERS_SUPPORTED diff --git a/projects/windows/ee.files b/projects/windows/ee.files index c66ab6d52..0a03961c2 100644 --- a/projects/windows/ee.files +++ b/projects/windows/ee.files @@ -1,4 +1,6 @@ +../../README.md ../../bin/assets/ee.ini +../../bin/assets/layouts/imported.css ../../bin/assets/layouts/test.css ../../bin/assets/layouts/test.xml ../../bin/assets/layouts/test_widgets.xml @@ -26,13 +28,11 @@ ../../include/eepp/audio/soundsource.hpp ../../include/eepp/audio/soundstream.hpp ../../include/eepp/config.hpp -../../include/eepp/core/allocator.hpp ../../include/eepp/core/core.hpp ../../include/eepp/core/debug.hpp ../../include/eepp/core.hpp ../../include/eepp/core/memorymanager.hpp ../../include/eepp/core/noncopyable.hpp -../../include/eepp/core/stlcontainers.hpp ../../include/eepp/core/string.hpp ../../include/eepp/core/utf.hpp ../../include/eepp/core/utf.inl @@ -49,7 +49,6 @@ ../../include/eepp/graphics/drawableresource.hpp ../../include/eepp/graphics/drawablesearcher.hpp ../../include/eepp/graphics/fontbmfont.hpp -../../include/eepp/graphics/fonthelper.hpp ../../include/eepp/graphics/font.hpp ../../include/eepp/graphics/fontmanager.hpp ../../include/eepp/graphics/fontsprite.hpp @@ -102,6 +101,7 @@ ../../include/eepp/graphics/textureloader.hpp ../../include/eepp/graphics/texturepacker.hpp ../../include/eepp/graphics/textureregion.hpp +../../include/eepp/graphics/triangledrawable.hpp ../../include/eepp/graphics/vertexbufferhelper.hpp ../../include/eepp/graphics/vertexbuffer.hpp ../../include/eepp/graphics/vertexbuffermanager.hpp @@ -215,7 +215,6 @@ ../../include/eepp/scene.hpp ../../include/eepp/scene/keyevent.hpp ../../include/eepp/scene/mouseevent.hpp -../../include/eepp/scene/nodeattribute.hpp ../../include/eepp/scene/node.hpp ../../include/eepp/scene/nodemessage.hpp ../../include/eepp/scene/scenemanager.hpp @@ -230,6 +229,7 @@ ../../include/eepp/system/directorypack.hpp ../../include/eepp/system/filesystem.hpp ../../include/eepp/system.hpp +../../include/eepp/system/functionstring.hpp ../../include/eepp/system/inifile.hpp ../../include/eepp/system/iostreamdeflate.hpp ../../include/eepp/system/iostreamfile.hpp @@ -288,17 +288,27 @@ ../../include/eepp/thirdparty/PlusCallback/callback.hpp ../../include/eepp/ui/base.hpp ../../include/eepp/ui.hpp +../../include/eepp/ui/css/mediaquery.hpp +../../include/eepp/ui/css/propertydefinition.hpp +../../include/eepp/ui/css/propertyspecification.hpp +../../include/eepp/ui/css/shorthanddefinition.hpp ../../include/eepp/ui/css/stylesheet.hpp ../../include/eepp/ui/css/stylesheetelement.hpp +../../include/eepp/ui/css/stylesheetlength.hpp ../../include/eepp/ui/css/stylesheetparser.hpp ../../include/eepp/ui/css/stylesheetpropertiesparser.hpp ../../include/eepp/ui/css/stylesheetproperty.hpp +../../include/eepp/ui/css/stylesheetpropertytransition.hpp ../../include/eepp/ui/css/stylesheetselector.hpp ../../include/eepp/ui/css/stylesheetselectorparser.hpp ../../include/eepp/ui/css/stylesheetselectorrule.hpp +../../include/eepp/ui/css/stylesheetspecification.hpp ../../include/eepp/ui/css/stylesheetstyle.hpp +../../include/eepp/ui/css/stylesheetvariable.hpp +../../include/eepp/ui/css/transitiondefinition.hpp ../../include/eepp/ui/marginmove/scale.hpp ../../include/eepp/ui/tools/textureatlaseditor.hpp +../../include/eepp/ui/tools/uicolorpicker.hpp ../../include/eepp/ui/uicheckbox.hpp ../../include/eepp/ui/uicombobox.hpp ../../include/eepp/ui/uicommondialog.hpp @@ -322,6 +332,7 @@ ../../include/eepp/ui/uimenusubmenu.hpp ../../include/eepp/ui/uimessagebox.hpp ../../include/eepp/ui/uinode.hpp +../../include/eepp/ui/uinodedrawable.hpp ../../include/eepp/ui/uipopupmenu.hpp ../../include/eepp/ui/uiprogressbar.hpp ../../include/eepp/ui/uipushbutton.hpp @@ -333,7 +344,6 @@ ../../include/eepp/ui/uiselectbutton.hpp ../../include/eepp/ui/uiskin.hpp ../../include/eepp/ui/uiskinstate.hpp -../../include/eepp/ui/uisliderbutton.hpp ../../include/eepp/ui/uislider.hpp ../../include/eepp/ui/uispinbox.hpp ../../include/eepp/ui/uisprite.hpp @@ -528,6 +538,7 @@ ../../src/eepp/graphics/texturepackertex.hpp ../../src/eepp/graphics/textureregion.cpp ../../src/eepp/graphics/scopedtexture.hpp +../../src/eepp/graphics/triangledrawable.cpp ../../src/eepp/graphics/vertexbuffer.cpp ../../src/eepp/graphics/vertexbuffermanager.cpp ../../src/eepp/graphics/vertexbuffermanager.hpp @@ -647,7 +658,6 @@ ../../src/eepp/scene/eventdispatcher.cpp ../../src/eepp/scene/keyevent.cpp ../../src/eepp/scene/mouseevent.cpp -../../src/eepp/scene/nodeattribute.cpp ../../src/eepp/scene/node.cpp ../../src/eepp/scene/nodemessage.cpp ../../src/eepp/scene/scenemanager.cpp @@ -659,6 +669,7 @@ ../../src/eepp/system/condition.cpp ../../src/eepp/system/directorypack.cpp ../../src/eepp/system/filesystem.cpp +../../src/eepp/system/functionstring.cpp ../../src/eepp/system/inifile.cpp ../../src/eepp/system/iostreamdeflate.cpp ../../src/eepp/system/iostreamfile.cpp @@ -706,19 +717,29 @@ ../../src/eepp/system/translator.cpp ../../src/eepp/system/virtualfilesystem.cpp ../../src/eepp/system/zip.cpp +../../src/eepp/ui/css/mediaquery.cpp +../../src/eepp/ui/css/propertydefinition.cpp +../../src/eepp/ui/css/propertyspecification.cpp +../../src/eepp/ui/css/shorthanddefinition.cpp ../../src/eepp/ui/css/stylesheet.cpp +../../src/eepp/ui/css/stylesheetlength.cpp ../../src/eepp/ui/css/stylesheetparser.cpp ../../src/eepp/ui/css/stylesheetpropertiesparser.cpp ../../src/eepp/ui/css/stylesheetproperty.cpp +../../src/eepp/ui/css/stylesheetpropertytransition.cpp ../../src/eepp/ui/css/stylesheetselector.cpp ../../src/eepp/ui/css/stylesheetselectorparser.cpp ../../src/eepp/ui/css/stylesheetselectorrule.cpp +../../src/eepp/ui/css/stylesheetspecification.cpp ../../src/eepp/ui/css/stylesheetstyle.cpp +../../src/eepp/ui/css/stylesheetvariable.cpp +../../src/eepp/ui/css/transitiondefinition.cpp ../../src/eepp/ui/tools/textureatlaseditor.cpp ../../src/eepp/ui/tools/textureatlasnew.cpp ../../src/eepp/ui/tools/textureatlasnew.hpp ../../src/eepp/ui/tools/textureatlastextureregioneditor.cpp ../../src/eepp/ui/tools/textureatlastextureregioneditor.hpp +../../src/eepp/ui/tools/uicolorpicker.cpp ../../src/eepp/ui/uicheckbox.cpp ../../src/eepp/ui/uicombobox.cpp ../../src/eepp/ui/uicommondialog.cpp @@ -739,6 +760,7 @@ ../../src/eepp/ui/uimenusubmenu.cpp ../../src/eepp/ui/uimessagebox.cpp ../../src/eepp/ui/uinode.cpp +../../src/eepp/ui/uinodedrawable.cpp ../../src/eepp/ui/uipopupmenu.cpp ../../src/eepp/ui/uiprogressbar.cpp ../../src/eepp/ui/uipushbutton.cpp @@ -750,7 +772,6 @@ ../../src/eepp/ui/uiselectbutton.cpp ../../src/eepp/ui/uiskin.cpp ../../src/eepp/ui/uiskinstate.cpp -../../src/eepp/ui/uisliderbutton.cpp ../../src/eepp/ui/uislider.cpp ../../src/eepp/ui/uispinbox.cpp ../../src/eepp/ui/uisprite.cpp diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 8f56b5902..705d98f69 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -161,6 +161,8 @@ Uint32 UITextInput::onFocus() { mTextBuffer.setActive( true ); resetWaitCursor(); + + getSceneNode()->getWindow()->startTextInput(); } return 1; @@ -168,6 +170,7 @@ Uint32 UITextInput::onFocus() { Uint32 UITextInput::onFocusLoss() { mTextBuffer.setActive( false ); + getSceneNode()->getWindow()->stopTextInput(); return UITextView::onFocusLoss(); } diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index e5081aa50..c0e841010 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -21,6 +21,109 @@ #define SDL2_THREADED_GLCONTEXT #endif +#if EE_PLATFORM == EE_PLATFORM_WIN +#include +#include +#include +#include + +bool WindowsIsProcessRunning( const char* processName, bool killProcess = false ) { + bool exists = false; + PROCESSENTRY32 entry = {}; + entry.dwSize = sizeof( PROCESSENTRY32 ); + HANDLE snapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); + if ( Process32First( snapshot, &entry ) ) { + while ( Process32Next( snapshot, &entry ) ) { + if ( !stricmp( entry.szExeFile, processName ) ) { + exists = true; + if ( killProcess ) { + HANDLE aProc = OpenProcess( PROCESS_TERMINATE, 0, entry.th32ProcessID ); + if ( aProc ) { + TerminateProcess( aProc, 9 ); + CloseHandle( aProc ); + } + } + break; + } + } + } + CloseHandle( snapshot ); + return exists; +} + +#ifndef ERROR_ELEVATION_REQUIRED +#define ERROR_ELEVATION_REQUIRED ( 740 ) +#endif // ERROR_ELEVATION_REQUIRED + +bool WindowsProcessLaunch( std::string command, HWND windowHwnd ) { + char expandedCmd[1024] = {}; + static PROCESS_INFORMATION pi = {}; + static STARTUPINFO si = {}; + si.cb = sizeof( si ); + ExpandEnvironmentStrings( command.c_str(), expandedCmd, 1024 ); + if ( CreateProcess( NULL, expandedCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) ) { + // Wait until child process exits. + WaitForSingleObject( pi.hProcess, 10000 ); + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + return true; + } else { + DWORD error = GetLastError(); + if ( error == ERROR_ELEVATION_REQUIRED && 0 != windowHwnd ) { + if ( reinterpret_cast( ShellExecute( windowHwnd, "open", expandedCmd, "", + NULL, SW_SHOWDEFAULT ) ) <= 32 ) { + return false; + } + } + } + return false; +} + +// 4ce576fa-83dc-4F88-951c-9d0782b4e376 +DEFINE_GUID( CLSID_UIHostNoLaunch, 0x4CE576FA, 0x83DC, 0x4f88, 0x95, 0x1C, 0x9D, 0x07, 0x82, 0xB4, + 0xE3, 0x76 ); + +// 37c994e7_432b_4834_a2f7_dce1f13b834b +DEFINE_GUID( IID_ITipInvocation, 0x37c994e7, 0x432b, 0x4834, 0xa2, 0xf7, 0xdc, 0xe1, 0xf1, 0x3b, + 0x83, 0x4b ); + +struct ITipInvocation : IUnknown { + virtual HRESULT STDMETHODCALLTYPE Toggle( HWND wnd ) = 0; +}; + +static bool WIN_OSK_VISIBLE = false; + +int showOSK( HWND windowHwnd ) { + if ( !WindowsIsProcessRunning( "TabTip.exe" ) ) { + WindowsIsProcessRunning( + "WindowsInternal.ComposableShell.Experiences.TextInput.InputApp.EXE", true ); + + std::string programFiles( Sys::getOSArchitecture() == "x64" ? "%ProgramW6432%" + : "%ProgramFiles(x86)%" ); + WindowsProcessLaunch( programFiles + "\\Common Files\\microsoft shared\\ink\\TabTip.exe", + windowHwnd ); + } + + CoInitialize( 0 ); + + ITipInvocation* tip; + CoCreateInstance( CLSID_UIHostNoLaunch, 0, CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER, + IID_ITipInvocation, (void**)&tip ); + if ( tip != NULL ) { + tip->Toggle( GetDesktopWindow() ); + tip->Release(); + WIN_OSK_VISIBLE = true; + } + + return 0; +} + +int hideOSK() { + WIN_OSK_VISIBLE = false; + return PostMessage( GetDesktopWindow(), WM_SYSCOMMAND, (int)SC_CLOSE, 0 ); +} +#endif + namespace EE { namespace Window { namespace Backend { namespace SDL2 { WindowSDL::WindowSDL( WindowSettings Settings, ContextSettings Context ) : @@ -46,13 +149,13 @@ WindowSDL::~WindowSDL() { SDL_GL_DeleteContext( mGLContextThread ); } - if ( NULL != mSDLWindow ) { - SDL_DestroyWindow( mSDLWindow ); - } - #ifdef EE_USE_WMINFO eeSAFE_DELETE( mWMinfo ); #endif + + if ( NULL != mSDLWindow ) { + SDL_DestroyWindow( mSDLWindow ); + } } bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { @@ -208,6 +311,10 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { SDL_GL_MakeCurrent( mSDLWindow, mGLContext ); +#ifdef EE_USE_WMINFO + mWMinfo = eeNew( WMInfo, ( mSDLWindow ) ); +#endif + if ( NULL == Renderer::existsSingleton() ) { Renderer::createSingleton( mWindow.ContextConfig.Version ); Renderer::instance()->init(); @@ -621,15 +728,31 @@ SDL_Window* WindowSDL::GetSDLWindow() const { } void WindowSDL::startTextInput() { - SDL_StartTextInput(); + if ( mWindow.WindowConfig.UseScreenKeyboard ) { +#if EE_PLATFORM == EE_PLATFORM_WIN + showOSK( getWindowHandler() ); +#else + SDL_StartTextInput(); +#endif + } } bool WindowSDL::isTextInputActive() { +#if EE_PLATFORM == EE_PLATFORM_WIN + return WIN_OSK_VISIBLE; +#else return SDL_TRUE == SDL_IsTextInputActive(); +#endif } void WindowSDL::stopTextInput() { - SDL_StopTextInput(); + if ( mWindow.WindowConfig.UseScreenKeyboard ) { +#if EE_PLATFORM == EE_PLATFORM_WIN + hideOSK(); +#else + SDL_StopTextInput(); +#endif + } } void WindowSDL::setTextInputRect( Rect& rect ) { diff --git a/src/eepp/window/backend/SDL2/wminfo.cpp b/src/eepp/window/backend/SDL2/wminfo.cpp index 6ceb6a783..5425ccb15 100644 --- a/src/eepp/window/backend/SDL2/wminfo.cpp +++ b/src/eepp/window/backend/SDL2/wminfo.cpp @@ -18,7 +18,7 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { #ifdef EE_WMINFO -WMInfo::WMInfo( SDL_Window* win ) : mWMInfo( eeNew( SDL_SysWMinfo, () ) ) { +WMInfo::WMInfo( SDL_Window* win ) : mWMInfo( eeMalloc( sizeof(SDL_SysWMinfo) ) ) { SDL_SysWMinfo* info = static_cast( mWMInfo ); SDL_VERSION( &info->version ); SDL_GetWindowWMInfo( win, info ); @@ -29,8 +29,7 @@ WMInfo::WMInfo( SDL_Window* win ) : mWMInfo( NULL ) {} WMInfo::~WMInfo() { #ifdef EE_WMINFO - SDL_SysWMinfo* info = static_cast( mWMInfo ); - eeSAFE_DELETE( info ); + eeSAFE_FREE( mWMInfo ); #endif } diff --git a/src/eepp/window/backend/SDL2/wminfo.hpp b/src/eepp/window/backend/SDL2/wminfo.hpp index e5f74c1e5..7c5ce1103 100644 --- a/src/eepp/window/backend/SDL2/wminfo.hpp +++ b/src/eepp/window/backend/SDL2/wminfo.hpp @@ -6,7 +6,7 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { -class WMInfo { +class EE_API WMInfo { public: WMInfo( SDL_Window* win ); diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index 5131bef88..1b33fb08c 100644 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -243,6 +243,7 @@ WindowSettings Engine::createWindowSettings( IniFile* ini, std::string iniKeyNam bool UseDesktopResolution = ini->getValueB( iniKeyName, "UseDesktopResolution", false ); std::string pixelDensityStr = ini->getValue( iniKeyName, "PixelDensity" ); float pixelDensity = PixelDensity::getPixelDensity(); + bool useScreenKeyboard = ini->getValueB( iniKeyName, "UseScreenKeyboard" ); if ( !pixelDensityStr.empty() ) { if ( String::toLower( pixelDensityStr ) == "auto" ) { @@ -283,7 +284,7 @@ WindowSettings Engine::createWindowSettings( IniFile* ini, std::string iniKeyNam std::string Caption = ini->getValue( iniKeyName, "WinCaption", "" ); WindowSettings WinSettings( Width, Height, Caption, Style, WinBackend, BitColor, Icon, - pixelDensity ); + pixelDensity, useScreenKeyboard ); return WinSettings; } @@ -339,7 +340,7 @@ ContextSettings Engine::createContextSettings( IniFile* ini, std::string iniKeyN ContextSettings Engine::createContextSettings( std::string iniPath, std::string iniKeyName ) { IniFile Ini( iniPath ); - return createContextSettings( &Ini ); + return createContextSettings( &Ini, iniKeyName ); } void Engine::enableSharedGLContext() { diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index cfc7f63f1..fe140b963 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -1,9 +1,5 @@ #include -#include -#include -#include - EE::Window::Window* win = NULL; void mainLoop() {