Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Update ImGuiPlatformInputSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
vlandemart committed Nov 7, 2022
1 parent fcfd07b commit cf2deaf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ImGuiNET.Unity/Platform/ImGuiPlatformInputSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,12 @@ void SetupKeyboard(ImGuiIOPtr io, Keyboard kb)
io.KeyMap[(int)ImGuiKey.Enter ] = (int)Key.Enter,
io.KeyMap[(int)ImGuiKey.Escape ] = (int)Key.Escape,
io.KeyMap[(int)ImGuiKey.KeyPadEnter] = (int)Key.NumpadEnter,
// letter keys mapped by display name to avoid being layout agnostic (used as shortcuts)
io.KeyMap[(int)ImGuiKey.A ] = (int)((KeyControl)kb["#(a)"]).keyCode, // for text edit CTRL+A: select all
io.KeyMap[(int)ImGuiKey.C ] = (int)((KeyControl)kb["#(c)"]).keyCode, // for text edit CTRL+C: copy
io.KeyMap[(int)ImGuiKey.V ] = (int)((KeyControl)kb["#(v)"]).keyCode, // for text edit CTRL+V: paste
io.KeyMap[(int)ImGuiKey.X ] = (int)((KeyControl)kb["#(x)"]).keyCode, // for text edit CTRL+X: cut
io.KeyMap[(int)ImGuiKey.Y ] = (int)((KeyControl)kb["#(y)"]).keyCode, // for text edit CTRL+Y: redo
io.KeyMap[(int)ImGuiKey.Z ] = (int)((KeyControl)kb["#(z)"]).keyCode, // for text edit CTRL+Z: undo
io.KeyMap[(int)ImGuiKey.A ] = (int)Key.A, // for text edit CTRL+A: select all
io.KeyMap[(int)ImGuiKey.C ] = (int)Key.C, // for text edit CTRL+C: copy
io.KeyMap[(int)ImGuiKey.V ] = (int)Key.V, // for text edit CTRL+V: paste
io.KeyMap[(int)ImGuiKey.X ] = (int)Key.X, // for text edit CTRL+X: cut
io.KeyMap[(int)ImGuiKey.Y ] = (int)Key.Y, // for text edit CTRL+Y: redo
io.KeyMap[(int)ImGuiKey.Z ] = (int)Key.Z, // for text edit CTRL+Z: undo
};
_keyboard.onTextInput += _textInput.Add;
}
Expand Down

0 comments on commit cf2deaf

Please sign in to comment.