Hotkey sugestion #8297
Closed
JunxHook
started this conversation in
Build/Link/Run/Fonts issues ONLY!
Replies: 1 comment
-
Please open Issues and not use Discussions for this, thank you. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Omar and the Dear ImGui community,
First of all, thank you for creating and maintaining such a powerful and versatile library! It has been an invaluable tool in my projects, and I’m constantly impressed by its flexibility.
I’d like to suggest the addition of a flexible hotkey system to Dear ImGui. This system would allow users to define custom keyboard shortcuts that trigger specific actions or callbacks in their applications. While the current input handling system is robust, a dedicated hotkey system would make it much easier to implement and manage custom shortcuts, especially for debugging, testing, or enabling hidden features.
Proposed Features:
Custom Hotkey Binding: Allow users to bind any combination of keys (with or without modifiers like Ctrl, Shift, or Alt) to specific actions.
Example: ImGui::BindHotkey(ImGuiKey_F12, { ToggleDebugMenu(); });
Dynamic Hotkeys: Enable hotkeys to be added, removed, or modified at runtime.
Context-Aware Hotkeys: Allow hotkeys to be active only in specific contexts (e.g., when a certain window is focused).
Conflict Detection: Provide a way to detect and resolve conflicts between hotkeys.
Save/Load Bindings: Optionally, allow hotkey bindings to be saved and loaded from a configuration file.
Example Use Cases:
Debugging: Quickly toggle debug overlays or tools with a keypress (e.g., F3 to show/hide debug info).
Testing: Trigger specific test scenarios or commands during development.
Custom Actions: Allow users to define their own shortcuts for frequently used actions.
Example API:
Benefits:
Flexibility: Developers can define custom shortcuts for any purpose.
Ease of Use: Simplifies the process of handling complex input combinations.
Extensibility: Can be used for debugging, testing, or even user-customizable shortcuts in applications.
If this feature aligns with the vision for Dear ImGui, I’d be happy to help with implementation or testing. Let me know what you think!
Thank you for your time and consideration.
Best regards,
[Gabriel]
Beta Was this translation helpful? Give feedback.
All reactions