Added GetKeyIndex() helper.

This commit is contained in:
ocornut
2015-07-02 21:32:29 -06:00
parent 0f9e2f8173
commit 6826ab3ffd
2 changed files with 17 additions and 8 deletions

View File

@ -371,8 +371,9 @@ namespace ImGui
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
// Inputs
IMGUI_API bool IsKeyDown(int key_index); // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry, uses your own indices!
IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // if repeat=true. uses io.KeyRepeatDelay / KeyRepeatRate
IMGUI_API int GetKeyIndex(ImGuiKey key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key]
IMGUI_API bool IsKeyDown(int key_index); // key_index into the keys_down[] array, imgui doesn't know the semantic of each entry, uses your own indices!
IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // uses user's key indices as stored in the keys_down[] array. if repeat=true. uses io.KeyRepeatDelay / KeyRepeatRate
IMGUI_API bool IsKeyReleased(int key_index); // "
IMGUI_API bool IsMouseDown(int button); // is mouse button held
IMGUI_API bool IsMouseClicked(int button, bool repeat = false); // did mouse button clicked (went from !Down to Down)