forked from kristianlm/Thumbkeyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.thumb
72 lines (57 loc) · 1.8 KB
/
main.thumb
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
;;; -*- clojure -*-
;;; clojure-mode seems to almost match our syntax, so better than nothing.
;;;
;;; this is the entry point of your Thumbkeyboard configuration.
"==================== LOADING main.thumb ====================" log
'!ctrl [ ctrl not ctrl! ] set
'!shift [ shift not shift! ] set
'!alt [ alt not alt! ] set
'!win [ win not win! ] set
;; repress: execute last operation, unless it's repress itself
'repress [ 'last.op get
dup 'repress = [ drop ] [ 'last* swap set ] ifte
'last* get press ] set
'!overlay [ overlay not overlay! ] set
'invert [ dup e not set ] set
'falsify [ false set ] set
'ctrl* false set
'shift* false set
'alt* false set
'win* false set
'capslock* false set
'shiftkey* false set
'!ctrl [ 'ctrl* invert ] set
'!shift [ 'shiftkey* invert 'shift* invert ] set
'!alt [ 'alt* invert ] set
'!win [ 'win* invert ] set
'!capslock [ 'capslock* invert 'shift* invert ] set
;; .. => ..
'mod-reset [ 'ctrl* falsify
'shiftkey* falsify
'shift* capslock* set
'alt* falsify
'win* falsify ] set
;; .. keypress/str => .. uppercased keypress/str
'shiftify! [
dup str?
[ upcase ] ;; string
[ true shift! ] ;; keypress
ifte
] set
'mod-merge [
'shiftify! shift* [ e ] [ drop ] ifte
'ctrl! ctrl* [ true swap e ] [ drop ] ifte
'alt! alt* [ true swap e ] [ drop ] ifte
'win! win* [ true swap e ] [ drop ] ifte
] set
'press [ mod-merge press* mod-reset ] set
[ x . | . .
. . | . .
x . | . . ] '!overlay bind!
[ . . | . x
. . | . x
. . | . . ] [ "#eeeeee" label.color! ] bind!
[ . . | . .
. . | . x
. . | . x ] [ "#111111" label.color! ] bind!
"default.layout.thumb" load