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

Revision 840, 3.7 KB (checked in by martin_r, 5 years ago)

AHK: Bugs ausgebessert.

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    isFurtherCompKey = 0
79    return 1
80  }
81}
82
83CheckCompAsc12(d,val1,val2) {
84  global
85  if (PriorCompKey == d)
86    if (Ebene = 1) and (val1 != "") {
87      if !DeadCompose
88        send {bs}
89      send % val1
90      isFurtherCompKey = 0
91      return 1
92    } else if (Ebene = 2) and (val2 != "") {
93      if !DeadCompose
94        send {bs}
95      send % val2
96      isFurtherCompKey = 0
97      return 1
98    }
99}
100
101CheckCompUni(d,val) {
102  global
103  if (PriorCompKey == d) {
104    PriorCompKey =
105    CompKey =
106    if !DeadCompose
107      send {bs}
108    isFurtherCompkey = 0
109    SendUnicodeChar(val)
110    return 1
111  }
112}
113
114CheckCompUni12(d,val1,val2){
115  global
116  if (PriorCompKey == d) {
117    if (Ebene = 1) and (val1 != "") {
118      PriorCompKey =
119      CompKey =
120      if !DeadCompose
121        send {bs}
122      isFurtherCompkey = 0
123      SendUnicodeChar(val1)
124      return 1
125    } else if (Ebene = 2) and (val2 != "") {
126      PriorCompKey =
127      CompKey =
128      if !DeadCompose
129        send {bs}
130      isFurtherCompkey = 0
131      SendUnicodeChar(val2)
132      return 1
133    }
134  }
135}
136
137CheckComp3Uni(d,val) {
138  global
139  if (PriorCompKey == d) {
140    PriorCompKey =
141    CompKey =
142    if !DeadCompose
143      send {bs}{bs}
144    isFurtherCompkey = 0
145    SendUnicodeChar(val)
146    return 1
147  }
148}
149
150CheckComp3Uni12(d,val1,val2) {
151  global
152  if (PriorCompKey == d) {
153    if (Ebene = 1) and (val1 != "") {
154      PriorCompKey =
155      CompKey =
156      if !DeadCompose
157        send {bs}{bs}
158      isFurtherCompkey = 0
159      SendUnicodeChar(val1)
160      return 1
161    } else if (Ebene = 2) and (val2 != "") {
162      PriorCompKey =
163      CompKey =
164      if !DeadCompose
165        send {bs}{bs}
166      isFurtherCompkey = 0
167      SendUnicodeChar(val2)
168      return 1
169    }
170  }
171}
172
173OutputChar(val) {
174  global
175  if !(CheckComp(val) and DeadCompose)
176    send % "{blind}" . val
177}
178
179OutputChar12(val1,val2) {
180  global
181  if (Ebene = 1)
182    c := val1
183  else c := val2
184  if !(CheckComp(c) and DeadCompose)
185    if GetKeyState("Shift","P") and isMod2Locked
186      send % "{blind}{Shift Up}" . c . "{Shift Down}"
187    else send % "{blind}" . c
188}
189
190CheckComp(d) {
191  global
192  if isFurtherCompkey {
193    PriorCompKey := CompKey := PriorCompKey . "_" . d
194    isFurtherCompkey = 0
195    CheckCompose()
196    if (CompKey = "")
197      return 1
198    else CompKey =
199  }
200  else
201  if PriorCompKey {
202    PriorCompKey := CompKey := PriorCompKey . "_" . d
203    CheckCompose()
204    if CompKey
205      isFurtherCompKey = 1
206    return 1
207  }
208  else
209  if (PriorDeadKey = "comp") {
210    CompKey := d
211    return 1
212  }
213}
Note: See TracBrowser for help on using the browser.