mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-13 12:18:08 +00:00
implement Demo App sections: Dialogs, Menu, Tray, Shell, CrashHang, Notification, Shortcuts etc. Fix some API bugs and implement GlobalShortcut-, Shell- and WebContents-API.
This commit is contained in:
26
ElectronNET.WebApp/Controllers/ShortcutsController.cs
Normal file
26
ElectronNET.WebApp/Controllers/ShortcutsController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using ElectronNET.API;
|
||||
using ElectronNET.API.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ElectronNET.WebApp.Controllers
|
||||
{
|
||||
public class ShortcutsController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
Electron.GlobalShortcut.Register("CommandOrControl+Alt+K", async () => {
|
||||
var options = new MessageBoxOptions("You pressed the registered global shortcut keybinding.")
|
||||
{
|
||||
Type = MessageBoxType.info,
|
||||
Title = "Success!"
|
||||
};
|
||||
|
||||
await Electron.Dialog.ShowMessageBoxAsync(options);
|
||||
});
|
||||
|
||||
Electron.App.WillQuit += () => Electron.GlobalShortcut.UnregisterAll();
|
||||
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user