mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 12:23:39 +01:00
Add VirtualKey -> ImGuiKey helper method to ImGuiHelpers (#917)
Co-authored-by: goat <goatsdev@protonmail.com>
This commit is contained in:
parent
1c581d4be3
commit
e5fc5dac3e
2 changed files with 23 additions and 1 deletions
|
|
@ -4,7 +4,9 @@ using System.Diagnostics;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Numerics;
|
||||
|
||||
using Dalamud.Game.ClientState.Keys;
|
||||
using ImGuiNET;
|
||||
using ImGuiScene;
|
||||
|
||||
namespace Dalamud.Interface
|
||||
{
|
||||
|
|
@ -215,6 +217,26 @@ namespace Dalamud.Interface
|
|||
target.Value!.BuildLookupTable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Map a VirtualKey keycode to an ImGuiKey enum value.
|
||||
/// </summary>
|
||||
/// <param name="key">The VirtualKey value to retrieve the ImGuiKey counterpart for.</param>
|
||||
/// <returns>The ImGuiKey that corresponds to this VirtualKey, or <c>ImGuiKey.None</c> otherwise.</returns>
|
||||
public static ImGuiKey VirtualKeyToImGuiKey(VirtualKey key)
|
||||
{
|
||||
return ImGui_Input_Impl_Direct.VirtualKeyToImGuiKey((int)key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Map an ImGuiKey enum value to a VirtualKey code.
|
||||
/// </summary>
|
||||
/// <param name="key">The ImGuiKey value to retrieve the VirtualKey counterpart for.</param>
|
||||
/// <returns>The VirtualKey that corresponds to this ImGuiKey, or <c>VirtualKey.NO_KEY</c> otherwise.</returns>
|
||||
public static VirtualKey ImGuiKeyToVirtualKey(ImGuiKey key)
|
||||
{
|
||||
return (VirtualKey)ImGui_Input_Impl_Direct.ImGuiKeyToVirtualKey(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get data needed for each new frame.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue