mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
reference: Hotkey Ctrl::RegisterSystemHotKey demontration
git-svn-id: svn://ultimatepp.org/upp/trunk@1588 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
239748b0d3
commit
09b739649b
3 changed files with 38 additions and 0 deletions
11
reference/HotKey/HotKey.upp
Normal file
11
reference/HotKey/HotKey.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
description "Ctrl::RegisterSystemHotKey demonstration\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
4
reference/HotKey/init
Normal file
4
reference/HotKey/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _HotKey_icpp_init_stub
|
||||
#define _HotKey_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
23
reference/HotKey/main.cpp
Normal file
23
reference/HotKey/main.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
void HotKey1()
|
||||
{
|
||||
PromptOK("HotKey1");
|
||||
}
|
||||
|
||||
void HotKey2()
|
||||
{
|
||||
PromptOK("HotKey2");
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
TopWindow win;
|
||||
int id = Ctrl::RegisterSystemHotKey(K_ALT|K_CTRL|K_F11, callback(HotKey1));
|
||||
Ctrl::RegisterSystemHotKey(K_ALT|K_CTRL|K_SHIFT|K_A, callback(HotKey2));
|
||||
win.Run();
|
||||
Ctrl::UnregisterSystemHotKey(id);
|
||||
win.Run();
|
||||
}
|
||||
Loading…
Reference in a new issue