using System;
using System.Threading.Tasks;
namespace ElectronNET.API.Interfaces
{
///
/// Detect keyboard events when the application does not have keyboard focus.
///
public interface IGlobalShortcut
{
///
/// Registers a global shortcut of accelerator.
/// The callback is called when the registered shortcut is pressed by the user.
///
/// When the accelerator is already taken by other applications, this call will
/// silently fail.This behavior is intended by operating systems, since they don’t
/// want applications to fight for global shortcuts.
///
void Register(string accelerator, Action function);
///
/// When the accelerator is already taken by other applications,
/// this call will still return false. This behavior is intended by operating systems,
/// since they don’t want applications to fight for global shortcuts.
///
/// Whether this application has registered accelerator.
Task IsRegisteredAsync(string accelerator);
///
/// Unregisters the global shortcut of accelerator.
///
void Unregister(string accelerator);
///
/// Unregisters all of the global shortcuts.
///
void UnregisterAll();
}
}