mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
0fab880126
commit
351994a6cc
2823 changed files with 619073 additions and 0 deletions
8
uppdev/Key/Key.upp
Normal file
8
uppdev/Key/Key.upp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
40
uppdev/Key/main.cpp
Normal file
40
uppdev/Key/main.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct MyApp : TopWindow {
|
||||
Label l;
|
||||
String k;
|
||||
|
||||
void Do() {
|
||||
static int ii;
|
||||
String x;
|
||||
if(GetCtrl())
|
||||
x << "Ctrl ";
|
||||
if(GetAlt())
|
||||
x << "Alt ";
|
||||
if(GetShift())
|
||||
x << "Shift ";
|
||||
x << k << ' ' << GetMousePos();
|
||||
l = x;
|
||||
}
|
||||
|
||||
bool Key(dword key, int count) {
|
||||
k = GetKeyDesc(key) + ' ' + FormatIntHex(key);
|
||||
if(key < 256)
|
||||
k << '\"' << (char)key << '\"';
|
||||
Do();
|
||||
}
|
||||
|
||||
typedef MyApp CLASSNAME;
|
||||
|
||||
MyApp() {
|
||||
Add(l.SizePos());
|
||||
SetTimeCallback(-100, THISBACK(Do));
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Run();
|
||||
}
|
||||
Loading…
Reference in a new issue