-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYahooKeyKeyIMEEgg.ahk
430 lines (425 loc) · 19.4 KB
/
YahooKeyKeyIMEEgg.ahk
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
#SingleInstance ignore
#Include localeEgg.ahk
Menu, Tray, Tip, %EggGuiTitle%
Menu, Tray, NoStandard
Menu, Tray, Add, %AboutItemMenuTray%, About
Menu, Tray, Default, %AboutItemMenuTray%
Menu, Tray, Click, 1
IfNotExist, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.plist
{
MsgBox, 16, %TitleYKKNotFound%, %MsgYKKNotFound%
ExitApp
}
IfNotExist, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.SmartMandarin.plist
{
MsgBox, 16, %TitleYKKNotFound%, %MsgYKKNotFound%
ExitApp
}
IfNotExist, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.TraditionalMandarin.plist
{
MsgBox, 16, %TitleYKKNotFound%, %MsgYKKNotFound%
ExitApp
}
IfNotExist, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.OneKey.plist
{
MsgBox, 16, %TitleYKKNotFound%, %MsgYKKNotFound%
ExitApp
}
Loop, Read, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.plist
{
If A_LoopReadLine contains </dict>
{
KeyKeyPlistDictCloseLine := A_Index
} else If A_LoopReadLine contains <key>IMEUnawareComposingBufferHeightPt</key>
{
IMEUnawareComposingBufferHeightPtKeyLine := A_Index
IMEUnawareComposingBufferHeightPtValueLine := A_Index + 1
FileReadLine, IMEUnawareComposingBufferHeightPtValue, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.plist, %IMEUnawareComposingBufferHeightPtValueLine%
IMEUnawareComposingBufferHeightPtValue := RegExReplace(IMEUnawareComposingBufferHeightPtValue, "\s+<string>","")
IMEUnawareComposingBufferHeightPtValue := RegExReplace(IMEUnawareComposingBufferHeightPtValue, "</string>","")
} else If A_LoopReadLine contains <key>OverrideUIFontName</key>
{
OverrideUIFontNameKeyLine := A_Index
OverrideUIFontNameValueLine := A_Index + 1
}
}
Loop, Read, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.SmartMandarin.plist
{
If A_LoopReadLine contains </dict>
{
KeyKeySmartMandarinPlistDictCloseLine := A_Index
} else If A_LoopReadLine contains <key>KeyboardLayout</key>
{
SmartMandarinKeyboardLayoutKeyLine := A_Index
SmartMandarinKeyboardLayoutValueLine := A_Index + 1
FileReadLine, SmartMandarinKeyboardLayoutValue, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.SmartMandarin.plist, %SmartMandarinKeyboardLayoutValueLine%
SmartMandarinKeyboardLayoutValue := RegExReplace(SmartMandarinKeyboardLayoutValue, "\s+<string>","")
SmartMandarinKeyboardLayoutValue := RegExReplace(SmartMandarinKeyboardLayoutValue, "</string>","")
} else If A_LoopReadLine contains <key>CandidateSelectionKeys</key>
{
SmartMandarinCandidateSelectionKeysKeyLine := A_Index
SmartMandarinCandidateSelectionKeysValueLine := A_Index + 1
FileReadLine, SmartMandarinCandidateSelectionKeysValue, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.SmartMandarin.plist, %SmartMandarinCandidateSelectionKeysValueLine%
SmartMandarinCandidateSelectionKeysValue := RegExReplace(SmartMandarinCandidateSelectionKeysValue, "\s+<string>","")
SmartMandarinCandidateSelectionKeysValue := RegExReplace(SmartMandarinCandidateSelectionKeysValue, "</string>","")
}
}
Loop, Read, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.TraditionalMandarin.plist
{
If A_LoopReadLine contains </dict>
{
KeyKeyTraditionalMandarinPlistDictCloseLine := A_Index
} else If A_LoopReadLine contains <key>KeyboardLayout</key>
{
TraditionalMandarinKeyboardLayoutKeyLine := A_Index
TraditionalMandarinKeyboardLayoutValueLine := A_Index + 1
FileReadLine, TraditionalMandarinKeyboardLayoutValue, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.TraditionalMandarin.plist, %TraditionalMandarinKeyboardLayoutValueLine%
TraditionalMandarinKeyboardLayoutValue := RegExReplace(TraditionalMandarinKeyboardLayoutValue, "\s+<string>","")
TraditionalMandarinKeyboardLayoutValue := RegExReplace(TraditionalMandarinKeyboardLayoutValue, "</string>","")
} else If A_LoopReadLine contains <key>CandidateSelectionKeys</key>
{
TraditionalMandarinCandidateSelectionKeysKeyLine := A_Index
TraditionalMandarinCandidateSelectionKeysValueLine := A_Index + 1
FileReadLine, TraditionalMandarinCandidateSelectionKeysValue, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.TraditionalMandarin.plist, %TraditionalMandarinCandidateSelectionKeysValueLine%
TraditionalMandarinCandidateSelectionKeysValue := RegExReplace(TraditionalMandarinCandidateSelectionKeysValue, "\s+<string>","")
TraditionalMandarinCandidateSelectionKeysValue := RegExReplace(TraditionalMandarinCandidateSelectionKeysValue, "</string>","")
}
}
Gui, Add, Button, x210 y270 w180 h30 gYKKEggGuiClose, %ButtonCancel%
Gui, Add, CheckBox, x20 y30 w180 h15 vSetIMEUnawareComposingBufferHeightPt, %CheckBoxIMEUnawareComposingBufferHeightPt%
Gui, Add, Edit, xp+180 yp w50 Limit2 Number
Gui, Add, UpDown, vIMEUnawareComposingBufferHeightPtNew Range8-72, 36
Gui, Add, Text, yp+5 xp+55, pt
Gui, Add, CheckBox, x20 y60 w380 h30 vOverrideUIFont, %CheckBoxOverrideUIFont%
Gui, Add, CheckBox, x20 yp+40 w380 h30 vSetKeyboardLayout, %CheckBoxKeyboardLayout%
Gui, Add, Radio, xp+20 yp+30 w100 h30 vUseHsu Checked, %Hsu%
Gui, Add, Radio, xp+100 yp w100 h30 vUseEten26, %Eten26%
Gui, Add, CheckBox, x20 y170 w180 h30 vSetCandidateSelectionKeys, %CheckBoxCandidateSelectionKeys%
Gui, Add, DropDownList, xp+180 yp+5 vCandidateSelectionKeysNew, aoeu`;qjk||aoeuhtns|aoeuidht|%DropDownListCandidateSelectionKeysMyOwn%
Gui, Add, CheckBox, x20 y210 w380 h30 vDisableOnekey, %CheckBoxDisableOnekey%
Gui, Add, Button, x10 y270 w180 h30 gApplyEgg, %ButtonOK%
Gui +LabelYKKEggGui
Gui, Show, xCenter yCenter w400 h320, %EggGuiTitle%
Return
ApplyEgg:
Gui, Submit
If (SetIMEUnawareComposingBufferHeightPt > 0 or OverrideUIFont > 0) {
IfExist, %A_Temp%\com.yahoo.KeyKey.plist.temp
{
FileSetAttrib, -RHS, %A_Temp%\com.yahoo.KeyKey.plist.temp
FileDelete, %A_Temp%\com.yahoo.KeyKey.plist.temp
}
Loop, Read, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.plist
{
If (SetIMEUnawareComposingBufferHeightPt > 0 and OverrideUIFont > 0) {
If (A_Index != IMEUnawareComposingBufferHeightPtKeyLine and A_Index != IMEUnawareComposingBufferHeightPtValueLine and A_Index != OverrideUIFontNameKeyLine and A_Index != OverrideUIFontNameValueLine) {
If (A_Index = KeyKeyPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.plist.temp
}
} else If (SetIMEUnawareComposingBufferHeightPt > 0) {
If (A_Index != IMEUnawareComposingBufferHeightPtKeyLine and A_Index != IMEUnawareComposingBufferHeightPtValueLine) {
If (A_Index = KeyKeyPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.plist.temp
}
} else If (OverrideUIFont > 0) {
If (A_Index != OverrideUIFontNameKeyLine and A_Index != OverrideUIFontNameValueLine) {
If (A_Index = KeyKeyPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.plist.temp
}
}
}
If (SetIMEUnawareComposingBufferHeightPt > 0) {
FileAppend, %A_Tab%<key>IMEUnawareComposingBufferHeightPt</key>`n%A_Tab%<string>%IMEUnawareComposingBufferHeightPtNew%</string>`n, %A_Temp%\com.yahoo.KeyKey.plist.temp
}
If (OverrideUIFont > 0) {
IfExist, %A_Temp%\ListFonts.exe
{
FileSetAttrib, -RHS, %A_Temp%\ListFonts.exe
FileDelete, %A_Temp%\ListFonts.exe
}
FileInstall, ListFonts.exe, %A_Temp%\ListFonts.exe, 1
IfExist, %A_Temp%\ListFonts.log
{
FileSetAttrib, -RHS, %A_Temp%\ListFonts.log
FileDelete, %A_Temp%\ListFonts.log
}
RunWait, %comspec% /c "%A_Temp%\ListFonts.exe > %A_Temp%\ListFonts.log", , Hide
FileSetAttrib, -RHS, %A_Temp%\ListFonts.exe
FileDelete, %A_Temp%\ListFonts.exe
FileRead, ListFonts, %A_Temp%\ListFonts.log
FileSetAttrib, -RHS, %A_Temp%\ListFonts.log
FileDelete, %A_Temp%\ListFonts.log
ListFonts := RegExReplace(ListFonts, "name: ")
InputBufferFontName:
InputBox, BufferFont, %TitleOverrideUIFont%, %MsgOverrideUIFont%, , , , , , , , %MingLiUName%
Loop, Parse, ListFonts, `n, `r
{
If A_LoopField contains %BufferFont%
{
CheckFontMatch = 1
}
}
If (CheckFontMatch != 1) {
MsgBox, 16, %TitleOverrideUIFontIllegal%, %MsgOverrideUIFontIllegal1%`n`n%BufferFont%`n`n%MsgOverrideUIFontIllegal2%
Goto, InputBufferFontName
}
ClipSaved := ClipboardAll
clipboard =
clipboard = %BufferFont%
ClipWait
; The following command is not available in Unicode version of AutoHotkey
; Also cause double-encode and break things.
; TODO: drop older Windows support or check Windows version first?
; Transform, BufferFont, Unicode
clipboard := ClipSaved
ClipSaved =
FileAppend, %A_Tab%<key>OverrideUIFontName</key>`n%A_Tab%<string>%BufferFont%</string>`n, %A_Temp%\com.yahoo.KeyKey.plist.temp
}
FileAppend, </dict>`n</plist>, %A_Temp%\com.yahoo.KeyKey.plist.temp
FileSetAttrib, -RHS, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.plist
FileMove, %A_Temp%\com.yahoo.KeyKey.plist.temp, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.plist, 1
}
KeyboardLayoutOrCandidateSelectionKeys:
If (SetKeyboardLayout > 0 or SetCandidateSelectionKeys > 0) {
If (SetCandidateSelectionKeys > 0 and CandidateSelectionKeysNew = DropDownListCandidateSelectionKeysMyOwn) {
InputBox, CandidateSelectionKeysNew, %TitleCandidateSelectionKeysNew%, %MsgCandidateSelectionKeysNew%
If ErrorLevel
{
SetCandidateSelectionKeys = 0
Goto, KeyboardLayoutOrCandidateSelectionKeys
}
StringLen, CandidateSelectionKeysNewLength, CandidateSelectionKeysNew
If (CandidateSelectionKeysNewLength < 8 or CandidateSelectionKeysNewLength > 10) {
MsgBox, 16, %TitleCandidateSelectionKeysNewLengthError%, %MsgCandidateSelectionKeysNewLengthError%
CandidateSelectionKeysNew = %DropDownListCandidateSelectionKeysMyOwn%
Goto, KeyboardLayoutOrCandidateSelectionKeys
}
StringLower, CandidateSelectionKeysNew, CandidateSelectionKeysNew
If CandidateSelectionKeysNew contains ~,!,@,#,$,`%,^,&,*,(,),{,},",<,>,?,+,|,_,:,%A_Space%,%A_Tab%
; "
{
MsgBox, 16, %TitleCandidateSelectionKeysNewIllegal%, %MsgCandidateSelectionKeysNewIllegal%
CandidateSelectionKeysNew = %DropDownListCandidateSelectionKeysMyOwn%
Goto, KeyboardLayoutOrCandidateSelectionKeys
}
TestKey = ``
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 1
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 2
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 3
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 4
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 5
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 6
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 7
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 8
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = 9
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = a
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = b
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = c
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = d
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = e
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = f
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = g
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = h
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = i
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = j
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = k
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = l
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = m
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = n
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = o
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = p
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = q
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = r
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = s
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = t
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = u
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = v
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = w
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = x
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = y
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = z
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = [
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = ]
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = '
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = ,
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = .
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = `;
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = /
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = =
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = \
Gosub, CandidateSelectionKeysNewArrayTest
TestKey = -
Gosub, CandidateSelectionKeysNewArrayTest
ClipSaved := ClipboardAll
clipboard =
clipboard = %CandidateSelectionKeysNew%
ClipWait
; The following command is not available in Unicode version of AutoHotkey
Transform, CandidateSelectionKeysNew, Unicode
clipboard := ClipSaved
ClipSaved =
}
IfExist, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
{
FileSetAttrib, -RHS, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
FileDelete, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
}
Loop, Read, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.SmartMandarin.plist
{
If (SetKeyboardLayout > 0 and SetCandidateSelectionKeys > 0) {
If (A_Index != SmartMandarinKeyboardLayoutKeyLine and A_Index != SmartMandarinKeyboardLayoutValueLine and A_Index != SmartMandarinCandidateSelectionKeysKeyLine and A_Index != SmartMandarinCandidateSelectionKeysValueLine) {
If (A_Index = KeyKeySmartMandarinPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
}
} else If (SetKeyboardLayout > 0) {
If (A_Index != SmartMandarinKeyboardLayoutKeyLine and A_Index != SmartMandarinKeyboardLayoutValueLine) {
If (A_Index = KeyKeySmartMandarinPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
}
} else If (SetCandidateSelectionKeys > 0) {
If (A_Index != SmartMandarinCandidateSelectionKeysKeyLine and A_Index != SmartMandarinCandidateSelectionKeysValueLine) {
If (A_Index = KeyKeySmartMandarinPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
}
}
}
If (SetKeyboardLayout > 0) {
If (UseHsu > 0) {
FileAppend, %A_Space% <key>KeyboardLayout</key>`n <string>Hsu</string>`n, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
} else If (UseEten26 > 0) {
FileAppend, %A_Space% <key>KeyboardLayout</key>`n <string>Eten26</string>`n, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
} else {
FileAppend, %A_Space% <key>KeyboardLayout</key>`n <string>Standard</string>`n, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
}
}
If (SetCandidateSelectionKeys > 0) {
FileAppend, %A_Space% <key>CandidateSelectionKeys</key>`n <string>%CandidateSelectionKeysNew%</string>`n, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
}
FileAppend, %A_Space% </dict>`n</plist>, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp
FileSetAttrib, -RHS, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.SmartMandarin.plist
FileMove, %A_Temp%\com.yahoo.KeyKey.SmartMandarin.plist.temp, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.SmartMandarin.plist, 1
IfExist, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
{
FileSetAttrib, -RHS, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
FileDelete, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
}
Loop, Read, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.TraditionalMandarin.plist
{
If (SetKeyboardLayout > 0 and SetCandidateSelectionKeys > 0) {
If (A_Index != TraditionalMandarinKeyboardLayoutKeyLine and A_Index != TraditionalMandarinKeyboardLayoutValueLine and A_Index != TraditionalMandarinCandidateSelectionKeysKeyLine and A_Index != TraditionalMandarinCandidateSelectionKeysValueLine) {
If (A_Index = KeyKeyTraditionalMandarinPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
}
} else If (SetKeyboardLayout > 0) {
If (A_Index != TraditionalMandarinKeyboardLayoutKeyLine and A_Index != TraditionalMandarinKeyboardLayoutValueLine) {
If (A_Index = KeyKeyTraditionalMandarinPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
}
} else If (SetCandidateSelectionKeys > 0) {
If (A_Index != TraditionalMandarinCandidateSelectionKeysKeyLine and A_Index != TraditionalMandarinCandidateSelectionKeysValueLine) {
If (A_Index = KeyKeyTraditionalMandarinPlistDictCloseLine) {
break
}
FileAppend, %A_LoopReadLine%`n, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
}
}
}
If (SetKeyboardLayout > 0) {
If (UseHsu > 0) {
FileAppend, %A_Space% <key>KeyboardLayout</key>`n <string>Hsu</string>`n, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
} else If (UseEten26 > 0) {
FileAppend, %A_Space% <key>KeyboardLayout</key>`n <string>Eten26</string>`n, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
} else {
FileAppend, %A_Space% <key>KeyboardLayout</key>`n <string>Standard</string>`n, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
}
}
If (SetCandidateSelectionKeys > 0) {
FileAppend, %A_Space% <key>CandidateSelectionKeys</key>`n <string>%CandidateSelectionKeysNew%</string>`n, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
}
FileAppend, %A_Space% </dict>`n</plist>, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp
FileSetAttrib, -RHS, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.TraditionalMandarin.plist
FileMove, %A_Temp%\com.yahoo.KeyKey.TraditionalMandarin.plist.temp, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.TraditionalMandarin.plist, 1
}
If (DisableOnekey > 0) {
FileCopy, com.yahoo.KeyKey.OneKey.plist, %AppData%\Yahoo! KeyKey\com.yahoo.KeyKey.OneKey.plist, 1
}
If (SetIMEUnawareComposingBufferHeightPt > 0 or OverrideUIFont > 0 or SetKeyboardLayout > 0 or SetCandidateSelectionKeys > 0) {
MsgBox, 36, %TitleDone%, %MsgNeedRelogin%
IfMsgBox Yes
Shutdown, 4
}
ExitApp
YKKEggGuiClose:
Gui, Destroy
ExitApp
About:
MsgBox, 64, %AboutItemMenuTray%, %ProjectHome%`n`n`n`n%Copyright%`n`n%License%`n%LicenseURL%`n
return
CandidateSelectionKeysNewArrayTest:
StringSplit, CandidateSelectionKeysNewArray, CandidateSelectionKeysNew, %TestKey%
If (CandidateSelectionKeysNewArray0 > 2) {
MsgBox, 16, %TitleCandidateSelectionKeysNewDuplicated%, %MsgCandidateSelectionKeysNewDuplicated%
CandidateSelectionKeysNew = %DropDownListCandidateSelectionKeysMyOwn%
Goto, KeyboardLayoutOrCandidateSelectionKeys
}
return