Skip to content

Commit

Permalink
Upgrade dep lib
Browse files Browse the repository at this point in the history
- imgui to 1.90.0
- vortice to 3.3.4
- added support for F12-24, browser_back, browser_forward keys
- fixed print screen key issue.
- release new version
  • Loading branch information
zaafar committed Nov 20, 2023
1 parent 2cff49d commit 30847b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Description>A library to create transparent overlays on the windows machines.</Description>
<PackageProjectUrl>https://github.com/zaafar/ClickableTransparentOverlay</PackageProjectUrl>
<RepositoryUrl>https://github.com/zaafar/ClickableTransparentOverlay</RepositoryUrl>
<Version>9.0.1</Version>
<Version>9.1.0</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand All @@ -24,10 +24,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.89.9.2" />
<PackageReference Include="ImGui.NET" Version="1.90.0.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.2" />
<PackageReference Include="Vortice.D3DCompiler" Version="3.2.0" />
<PackageReference Include="Vortice.Direct3D11" Version="3.2.0" />
<PackageReference Include="Vortice.D3DCompiler" Version="3.3.4" />
<PackageReference Include="Vortice.Direct3D11" Version="3.3.4" />
</ItemGroup>

</Project>
9 changes: 8 additions & 1 deletion ClickableTransparentOverlay/ImGuiInputHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public bool ProcessMessage(WindowMessage msg, UIntPtr wParam, IntPtr lParam)
bool is_key_down = msg == WindowMessage.SysKeyDown || msg == WindowMessage.KeyDown;
if ((ulong)wParam < 256 && TryMapKey((VK)wParam, out ImGuiKey imguikey))
{
if (imguikey == ImGuiKey.PrintScreen && !is_key_down)
{
io.AddKeyEvent(imguikey, true);
}

io.AddKeyEvent(imguikey, is_key_down);
}

Expand Down Expand Up @@ -161,7 +166,7 @@ static ImGuiKey KeyToImGuiKeyShortcut(VK keyToConvert, VK startKey1, ImGuiKey st

result = key switch
{
>= VK.F1 and <= VK.F12 => KeyToImGuiKeyShortcut(key, VK.F1, ImGuiKey.F1),
>= VK.F1 and <= VK.F24 => KeyToImGuiKeyShortcut(key, VK.F1, ImGuiKey.F1),
>= VK.NUMPAD0 and <= VK.NUMPAD9 => KeyToImGuiKeyShortcut(key, VK.NUMPAD0, ImGuiKey.Keypad0),
>= VK.KEY_A and <= VK.KEY_Z => KeyToImGuiKeyShortcut(key, VK.KEY_A, ImGuiKey.A),
>= VK.KEY_0 and <= VK.KEY_9 => KeyToImGuiKeyShortcut(key, VK.KEY_0, ImGuiKey._0),
Expand Down Expand Up @@ -213,6 +218,8 @@ static ImGuiKey KeyToImGuiKeyShortcut(VK keyToConvert, VK startKey1, ImGuiKey st
VK.RMENU => ImGuiKey.RightAlt,
VK.RWIN => ImGuiKey.RightSuper,
VK.APPS => ImGuiKey.Menu,
VK.BROWSER_BACK => ImGuiKey.AppBack,
VK.BROWSER_FORWARD => ImGuiKey.AppForward,
_ => ImGuiKey.None
};

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ https://www.nuget.org/packages/ClickableTransparentOverlay
Lots of classes in this library (e.g. ImGuiRenderer, ImGuiInputHandler and etc) closely
follow (if not identical to) the official example in c++ ImGui library
([here](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_dx11.cpp "Last changelog looked was 2022-10-11")
and [here](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_win32.cpp "Last changelog looked was 2023-04-04")).
and [here](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_win32.cpp "Last changelog looked was 2023-10-05")).
This allows us to easily update this library if something changes over there.


Expand Down

0 comments on commit 30847b1

Please sign in to comment.