Skip to content

Commit

Permalink
Merge branch '2.6.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Nov 2, 2024
2 parents cdf8a7e + 188d5d1 commit 918b8b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
-DIMGUI_SFML_BUILD_EXAMPLES=ON \
-DIMGUI_SFML_BUILD_TESTING=ON \
-DIMGUI_SFML_ENABLE_WARNINGS=ON \
-DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON \
${{matrix.platform.flags}} \
${{matrix.config.flags}}
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(imgui_sfml VERSION 3.0.0 LANGUAGES CXX)

option(IMGUI_SFML_FIND_SFML "Use find_package to find SFML" ON)
option(IMGUI_SFML_ENABLE_WARNINGS "Enable compiler warnings" OFF)
option(IMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS "Disable obsolete ImGui functions" OFF)

# If you want to use your own user config when compiling ImGui, please set the following variables
# For example, if you have your config in /path/to/dir/with/config/myconfig.h, set the variables as follows:
Expand Down Expand Up @@ -78,6 +79,9 @@ if(BUILD_SHARED_LIBS)
set_target_properties(ImGui-SFML PROPERTIES DEFINE_SYMBOL "IMGUI_SFML_EXPORTS")
set_target_properties(ImGui-SFML PROPERTIES DEBUG_POSTFIX "_d")
endif()
if(IMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS)
target_compile_definitions(ImGui-SFML PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
endif()

# Add compiler warnings
if(IMGUI_SFML_ENABLE_WARNINGS)
Expand Down
16 changes: 8 additions & 8 deletions imgui-SFML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ void ProcessEvent(const sf::Window& window, const sf::Event& event)
}
else
{
io.AddKeyEvent(ImGuiKey_ModCtrl, keyChanged.control);
io.AddKeyEvent(ImGuiKey_ModShift, keyChanged.shift);
io.AddKeyEvent(ImGuiKey_ModAlt, keyChanged.alt);
io.AddKeyEvent(ImGuiKey_ModSuper, keyChanged.system);
io.AddKeyEvent(ImGuiMod_Ctrl, keyChanged.control);
io.AddKeyEvent(ImGuiMod_Shift, keyChanged.shift);
io.AddKeyEvent(ImGuiMod_Alt, keyChanged.alt);
io.AddKeyEvent(ImGuiMod_Super, keyChanged.system);
}

const ImGuiKey key = keycodeToImGuiKey(keyChanged.code);
Expand Down Expand Up @@ -1481,16 +1481,16 @@ ImGuiKey keycodeToImGuiMod(sf::Keyboard::Key code)
{
case sf::Keyboard::Key::LControl:
case sf::Keyboard::Key::RControl:
return ImGuiKey_ModCtrl;
return ImGuiMod_Ctrl;
case sf::Keyboard::Key::LShift:
case sf::Keyboard::Key::RShift:
return ImGuiKey_ModShift;
return ImGuiMod_Shift;
case sf::Keyboard::Key::LAlt:
case sf::Keyboard::Key::RAlt:
return ImGuiKey_ModAlt;
return ImGuiMod_Alt;
case sf::Keyboard::Key::LSystem:
case sf::Keyboard::Key::RSystem:
return ImGuiKey_ModSuper;
return ImGuiMod_Super;
default:
break;
}
Expand Down

0 comments on commit 918b8b4

Please sign in to comment.