|
MōBrowser API
|
Allows handling global keyboard shortcuts in the application. More...
#include <global_shortcuts.hpp>
Public Member Functions | |
| virtual bool | registerShortcut (const Shortcut &shortcut, std::function< void(const Shortcut &)> handler)=0 |
| Registers a global shortcut along with a handler function to be executed when the shortcut is activated. | |
| virtual void | unregisterShortcut (const Shortcut &shortcut)=0 |
| Unregisters a previously registered shortcut. | |
Allows handling global keyboard shortcuts in the application.
Provides an interface for registering, unregistering, and checking the status of shortcuts, as well as defining actions to be taken when a shortcut is activated.
|
pure virtual |
Registers a global shortcut along with a handler function to be executed when the shortcut is activated.
When a shortcut with the COMMAND_OR_CTRL modifier is activated, the handler will receive it as COMMAND or CTRL, depending on the platform.
The shortcut registration may fail if the same global shortcut is already registered by any running application or if it's a system-wide shortcut.
| shortcut | the keyboard shortcut to register. |
| handler | the function to be called when the shortcut is activated. |
true if the shortcut has been successfully registered.
|
pure virtual |
Unregisters a previously registered shortcut.
If the shortcut has not been registered, or is registered by another process, the method does nothing.
| shortcut | the keyboard shortcut to unregister. |