root/windows/autohotkey/Source/Methods-Other.ahk @ 838

Revision 838, 3.6 KB (checked in by martin_r, 5 years ago)

Compose.ahk als zentralen Ort für (neue) Cokos geschaffen.
Weitere Vorbereitungen zur Aufnahme weiterer Cokos.
›©‹ jetzt auch wieder mit großem ›o‹.

Line 
1deadAsc(val, a) {
2  global
3  if !DeadSilence
4    send % val
5  DeadKey := a
6}
7
8deadUni(val, a) {
9  global
10  if !DeadSilence
11    SendUnicodeChar(val)
12  DeadKey := a
13}
14
15undeadAsc(val) {
16  global
17  if DeadSilence
18    send % val
19  else
20    send % "{bs}" . val
21}
22
23undeadUni(val){
24  global
25  if !DeadSilence
26    send {bs}
27  SendUnicodeChar(val)
28}
29
30CheckDeadAsc(d,val) {
31  global
32  if (PriorDeadKey == d) {
33    undeadAsc(val)
34    return 1
35  }
36}
37
38CheckDeadUni(d,val) {
39  global
40  if (PriorDeadKey == d) {
41    undeadUni(val)
42    return 1
43  }
44}
45
46CheckDeadAsc12(d,val1,val2) {
47  global
48  if (PriorDeadKey == d){
49    if (Ebene = 1) and (val1 != "") {
50      undeadAsc(val1)
51      return 1
52    } else if (Ebene = 2) and (val2 != "") {
53      undeadAsc(val2)
54      return 1
55    }
56  }
57}
58
59CheckDeadUni12(d,val1,val2) {
60  global
61  if(PriorDeadKey == d) {
62    if (Ebene = 1) and (val1 != "") {
63      undeadUni(val1)
64      return 1
65    } else if (Ebene = 2) and (val2 != "") {
66      undeadUni(val2)
67      return 1
68    }
69  }
70}
71
72CheckCompAsc(d,val) {
73  global
74  if (PriorCompKey == d) {
75    if !DeadCompose
76      send {bs}
77    send % val
78    return 1
79  }
80}
81
82CheckCompAsc12(d,val1,val2) {
83  global
84  if (PriorCompKey == d)
85    if (Ebene = 1) and (val1 != "") {
86      if !DeadCompose
87        send {bs}
88      send % val1
89      return 1
90    } else if (Ebene = 2) and (val2 != "") {
91      if !DeadCompose
92        send {bs}
93      send % val2
94      isSecondCompKey = 0
95      return 1
96    }
97}
98
99CheckCompUni(d,val) {
100  global
101  if (PriorCompKey == d) {
102    PriorCompKey =
103    if !DeadCompose
104      send {bs}
105    isFurtherCompkey = 0
106    SendUnicodeChar(val)
107    return 1
108  }
109}
110
111CheckCompUni12(d,val1,val2){
112  global
113  if (PriorCompKey == d) {
114    if (Ebene = 1) and (val1 != "") {
115      PriorCompKey =
116      if !DeadCompose
117        send {bs}
118      isFurtherCompkey = 0
119      SendUnicodeChar(val1)
120      return 1
121    } else if (Ebene = 2) and (val2 != "") {
122      PriorCompKey =
123      if !DeadCompose
124        send {bs}
125      isFurtherCompkey = 0
126      SendUnicodeChar(val2)
127      return 1
128    }
129  }
130}
131
132CheckComp3Uni(d,val) {
133  global
134  if (PriorCompKey == d) {
135    PriorCompKey =
136    if !DeadCompose
137      send {bs}{bs}
138    isFurtherCompkey = 0
139    SendUnicodeChar(val)
140    return 1
141  }
142}
143
144CheckComp3Uni12(d,val1,val2) {
145  global
146  if (PriorCompKey == d) {
147    if (Ebene = 1) and (val1 != "") {
148      PriorCompKey =
149      if !DeadCompose
150        send {bs}{bs}
151      isFurtherCompkey = 0
152      SendUnicodeChar(val1)
153      return 1
154    } else if (Ebene = 2) and (val2 != "") {
155      PriorCompKey =
156      if !DeadCompose
157        send {bs}{bs}
158      isFurtherCompkey = 0
159      SendUnicodeChar(val2)
160      return 1
161    }
162  }
163}
164
165OutputChar(val) {
166  global
167  if !(CheckComp(val) and DeadCompose)
168    send % "{blind}" . val
169}
170
171OutputChar12(val1,val2) {
172  global
173  if (Ebene = 1)
174    c := val1
175  else c := val2
176  if !(CheckComp(c) and DeadCompose)
177    if GetKeyState("Shift","P") and isMod2Locked
178      send % "{blind}{Shift Up}" . c . "{Shift Down}"
179    else send % "{blind}" . c
180}
181
182CheckComp(d) {
183  global
184  if isFurtherCompkey {
185    PriorCompKey := CompKey := PriorCompKey . "_" . d
186    CheckCompose()
187    CompKey =
188    isFurtherCompkey := 0
189    return 1
190  }
191  else
192  if PriorCompKey {
193    PriorCompKey := CompKey := PriorCompKey . "_" . d
194    CheckCompose()
195    isFurtherCompKey := 1
196    return 1
197  }
198  else
199  if (PriorDeadKey = "comp") {
200    CompKey := d
201    return 1
202  }
203}
Note: See TracBrowser for help on using the browser.