1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#define KEY_MAKE(key_name, x1, y1, x2, y2) \
part {name,key_##key_name; type,RECT; mouse_events,1; \
description {state, "default" 0.0; color, 255 100 100 255; \
rel1.relative, x1 y1; rel2.relative, x2 y2;} \
description {state, "push" 0.0; inherit, "default" 0.0; \
color, 100 100 255 255; } \
} \
part {name,key_name##_txt; type,TEXT; mouse_events,1; \
description {color, 0 0 0 255; \
rel1 {relative, 0.0 0.0; to, key_##key_name; } \
rel2 {relative, 1.0 1.0; to, key_##key_name; } \
text {text, #key_name; font: "Sans"; size, 26; align, 0.5 0.5; } \
} \
}
collections {
group {
name, "main";
parts {
part {
name, "background";
type, RECT;
mouse_events, 1;
description {
state, "default" 0;
color, 255 255 255 255;
rel1.relative, 0.0 0.0;
rel2.relative, 1.0 1.0;
}
}
KEY_MAKE(tap, 0.02, 0.02, 0.48, 0.28)
KEY_MAKE(multi, 0.52, 0.02, 0.98, 0.28)
KEY_MAKE(key, 0.02, 0.32, 0.48, 0.58)
KEY_MAKE(hold, 0.52, 0.32, 0.98, 0.58)
KEY_MAKE(hw_tap, 0.02, 0.62, 0.48, 0.98)
KEY_MAKE(hw_hold, 0.52, 0.62, 0.98, 0.98)
programs {
program {
name, "btn_clicked";
signal, "mouse,down,1";
action, SIGNAL_EMIT "mouse,down" "key_*";
}
}
}
}
|