From d1b98bdc3f0a62e1aaa4476acad38ed0e3a25a31 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 21 Jan 2020 08:44:38 +0000 Subject: [PATCH] .reference git-svn-id: svn://ultimatepp.org/upp/trunk@13921 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- reference/HotKey/main.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/reference/HotKey/main.cpp b/reference/HotKey/main.cpp index 402fee3ca..a4b346092 100644 --- a/reference/HotKey/main.cpp +++ b/reference/HotKey/main.cpp @@ -2,21 +2,11 @@ using namespace Upp; -void HotKey1() -{ - PromptOK("HotKey1"); -} - -void HotKey2() -{ - PromptOK("HotKey2"); -} - GUI_APP_MAIN { TopWindow win; - int id = Ctrl::RegisterSystemHotKey(K_CTRL|K_F1, callback(HotKey1)); - Ctrl::RegisterSystemHotKey(K_ALT|K_CTRL|K_SHIFT|K_A, callback(HotKey2)); + int id = Ctrl::RegisterSystemHotKey(K_CTRL|K_F1, [] { PromptOK("Ctrl+F1"); }); + Ctrl::RegisterSystemHotKey(K_ALT|K_CTRL|K_SHIFT|K_A, [] { PromptOK("Ctrl+Alt+Shift+A"); }); win.Run(); Ctrl::UnregisterSystemHotKey(id); win.Run();