Compose-Automatisierung für den AHK
This commit is contained in:
parent
9b05942e12
commit
cc2407342f
@ -450,7 +450,7 @@
|
||||
<dead_tilde> <dead_tilde> : "̃" U0303 # COMBINING TILDE
|
||||
<dead_macron> <dead_macron> : "̄" U0304 # COMBINING MACRON
|
||||
<dead_diaeresis> <dead_diaeresis> : "̈" U0308 # COMBINING DIAERESIS
|
||||
<dead_stroke> <dead_stroke> : "̷" U0337 # COMBINING SHORT SOLIDUS OVERLAY
|
||||
<dead_stroke> <dead_stroke> : "̷" U0338 # COMBINING SHORT SOLIDUS OVERLAY
|
||||
<dead_doubleacute> <dead_doubleacute> : "̋" U030B # COMBINING DOUBLE ACUTE ACCENT
|
||||
<U02CC> <U02CC> : "̦" U0326 # COMBINING COMMA BELOW
|
||||
<Multi_key> <underscore> <underscore> : "̲" U0332 # COMBINING LOW LINE
|
||||
|
2496
Compose/en_US.neo
Normal file
2496
Compose/en_US.neo
Normal file
File diff suppressed because it is too large
Load Diff
@ -16,13 +16,17 @@ Matthias Wächter <matthias (at) waechter.wiz. a t>
|
||||
‐ Ausgiebig testen … (besonders Vollständigkeit bei Deadkeys).
|
||||
‐ Compose vollständig implementieren (Welche Methode ist hierzu am besten geeignet?).
|
||||
‐ Bessere Lösung für das Leeren von PriorDeadKey finden, damit die Sondertasten nicht mehr abgefangen werden müssen.
|
||||
‐ Bildschirmtastatur anpassen.
|
||||
|
||||
=== Ideen und Vorschläge ===
|
||||
‐ Die Compose‐Kombinationen sollen automatisch aus den Referenzdateien im Compose‐Verzeichnis erzeugt werden.
|
||||
‐ Modi für vertauschte Ziffern in der Zahlenreihe und auf der 4. Ebene.
|
||||
|
||||
=== Änderungshistorie ===
|
||||
|
||||
Revision 872 (von Martin Roppelt)
|
||||
‐ Alle Cokos automatisch eingefügt.
|
||||
‐ Compose-Playground gelöscht.
|
||||
‐ Anpassung an die Referenz.
|
||||
Revision 864 (von Martin Roppelt)
|
||||
‐ 253/2822 Cokos ≙ 9%.
|
||||
Revision 849 (von Martin Roppelt)
|
||||
|
38
windows/autohotkey/Compose/AutoComp1.bas
Normal file
38
windows/autohotkey/Compose/AutoComp1.bas
Normal file
@ -0,0 +1,38 @@
|
||||
Rem Compose-AHK-Konverter
|
||||
Rem © 2008 Martin Paul Roppelt (m.p.roppelt@web.de) – GPL 2/3
|
||||
Rem
|
||||
Rem Basic-Datei für OpenOffice (2.4):
|
||||
Rem Dateipfade an das Zielsystem anpassen!
|
||||
Rem
|
||||
Rem Anleitung:
|
||||
Rem OpenOffice-Basic aufrufen (Alt-x,m,v,m; Alt-n).
|
||||
Rem Strg-a; Symbolleisten-Schaltfläche: BASIC-Quelltext einfügen, diese Datei auswählen.
|
||||
Rem Skript ausführen (Alt-x,m,a oder F5).
|
||||
|
||||
|
||||
Sub Main
|
||||
Open "C:\Users\Martin_2\NEO\Compose\Compose.neo" For Input Lock Write As #1
|
||||
Open "C:\Users\Martin_2\NEO\Compose\en_US.UTF-8" For Input Lock Write As #2
|
||||
Open "C:\Users\Martin_2\Programmieren\NEO\ComposeList.txt" For Output Lock Read Write As #3
|
||||
|
||||
LeseDatei(1)
|
||||
LeseDatei(2)
|
||||
|
||||
Close 1, 2, 3
|
||||
End Sub
|
||||
|
||||
Sub LeseDatei(DateiNummer% as Integer)
|
||||
While Not Eof(DateiNummer%)
|
||||
Line Input #DateiNummer%, DateiZeile$
|
||||
Dateizeile$ = LTrim(DateiZeile$)
|
||||
If Left(DateiZeile$, 1) = "<" Then
|
||||
DoppelpunktPosition% = InStr(DateiZeile$, ":")
|
||||
Definition$ = RTrim( Left(DateiZeile$, DoppelpunktPosition% - 1) )
|
||||
KlammerAufPosition1% = InStr(Definition$, "<")
|
||||
KlammerZuPosition1% = InStr(Definition$, ">")
|
||||
Taste1$ = Mid(Definition$, KlammerAufPosition1% + 1, KlammerZuPosition1% - KlammerAufPosition1% - 1)
|
||||
If Taste1$ = "Multi_key" Then Print #3, DateiZeile$
|
||||
End If
|
||||
Wend
|
||||
End Sub
|
||||
|
52
windows/autohotkey/Compose/AutoComp2.bas
Normal file
52
windows/autohotkey/Compose/AutoComp2.bas
Normal file
@ -0,0 +1,52 @@
|
||||
REM ***** BASIC *****
|
||||
|
||||
'Programm zur Umwandlung einer ComposeList.txt-Datei in eine Compose.ahk-Datei.
|
||||
'© 14. und 15. Sept. 2008 Martin Paul Roppelt (m.p.roppelt@web.de) – GPL 2/3
|
||||
|
||||
'Anleitung:
|
||||
'Pfade anpassen :-)
|
||||
'Alle Tabulatoren durch ein /einzelnes/ Leerzeichen ersetzen.
|
||||
'Skript ausführen.
|
||||
'Korrektur von ein paar ungelösten kleinen Problemchen:
|
||||
'Letzte Zeile der Ausgabedatei durch "}" ersetzen.
|
||||
'Folgende Zeilen abändern (muss man in der Quelldatei suchen!):
|
||||
'CheckCompUni("<t> <z>", 0xE04A", 0x) ->
|
||||
'CheckCompUni("<???? <????", 0x????) ->
|
||||
'CheckCompUni("<t> <z>", 0xE04A)
|
||||
'CheckCompUni("<?> <?>", 0x????)
|
||||
'Compose unter Windows genießen!
|
||||
|
||||
Sub Main
|
||||
Open "C:\Users\Martin_2\Programmieren\NEO\ComposeList16.txt" For Binary Lock Write As #1
|
||||
Open "C:\Users\Martin_2\NEO\windows\autohotkey\Source\Compose.ahk" For Output Lock Read Write As #2
|
||||
Print #2, "CheckCompose() {"
|
||||
Print #2, "CheckCompUni("; chr(34);
|
||||
Position& = -2
|
||||
For Position& = 1 To Lof(1) Step 2
|
||||
Get #1, Position&, a%
|
||||
If a% = 10 Then
|
||||
Print #2, ")" : Klammer% = 0: Kommentar% = 0: Quotedbl% = 0
|
||||
Print #2, "CheckCompUni("; chr(34);
|
||||
ElseIf a%=asc(":") Then
|
||||
Print #2, chr(34); ", 0x";
|
||||
Zeichen% = 1
|
||||
ElseIf a%=asc(" ") Then
|
||||
ElseIf a%=asc("<") Then
|
||||
Klammer% = Klammer% + 1
|
||||
If Klammer% > 2 Then Print #2, " ";
|
||||
If Klammer% <> 1 and Kommentar% <> 1 Then Print #2, "<";
|
||||
ElseIf a% = 34 Then
|
||||
Quotedbl% = Quotedbl% + 1
|
||||
If Quotedbl% = 2 Then
|
||||
Kommentar% = 1
|
||||
Zeichen = 0
|
||||
EndIf
|
||||
ElseIf Klammer% <> 1 and a% < 255 and a% > 0 and Kommentar% <> 1 and Zeichen% <> 1 Then
|
||||
Print #2, Chr(a%);
|
||||
ElseIf Klammer% <> 1 and Kommentar% <> 1 Then
|
||||
If a% <> -257 Then Print #2, Iif(Len(Hex(a%))>4, Right(Hex(a%),4),Hex(a%));
|
||||
End If
|
||||
Next
|
||||
Print #2, "}"
|
||||
Close 1, 2
|
||||
End Sub
|
@ -14,6 +14,3 @@
|
||||
#Include %a_scriptdir%\Compose.ahk
|
||||
#Include %a_scriptdir%\Methods-Unicode.ahk
|
||||
#Include %a_scriptdir%\Methods-ScreenKeyboard.ahk
|
||||
; Eines schönen Tages sollten auch die Compose-Kombinationen automatisch aus der Referenz erzeugt werden.
|
||||
; Derzeitig gibt es nur den (höchst instabilen und experimentellen!) Compose-Playground:
|
||||
; #Include *i %a_scriptdir%\..\Compose\Compose-all-in-one.ahk
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -86,7 +86,6 @@ EbeneAktualisieren() {
|
||||
Ebene = 6
|
||||
Ebene8 = 1
|
||||
} Ebene12 := ((Ebene = 1) or (Ebene = 2))
|
||||
Ebene14 := ((Ebene = 1) or (Ebene = 4))
|
||||
NumLock := GetKeyState("NumLock", "T")
|
||||
noCaps := 0
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
deadAsc(val, a) {
|
||||
deadAsc(val1, val2, a) {
|
||||
global
|
||||
if !DeadSilence
|
||||
send % val
|
||||
OutputChar(val1, val2)
|
||||
DeadKey := a
|
||||
}
|
||||
|
||||
deadUni(val, a) {
|
||||
deadUni(val1, val2, a) {
|
||||
global
|
||||
if !DeadSilence
|
||||
SendUnicodeChar(val)
|
||||
SendUnicodeChar(val1, val2)
|
||||
DeadKey := a
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ undeadUni(val){
|
||||
global
|
||||
if !DeadSilence
|
||||
send {bs}
|
||||
SendUnicodeChar(val)
|
||||
SendUnicodeChar(val, "")
|
||||
}
|
||||
|
||||
CheckDeadAsc(d,val) {
|
||||
@ -69,43 +69,34 @@ CheckDeadUni12(d,val1,val2) {
|
||||
}
|
||||
}
|
||||
|
||||
CheckCompAsc(d,val) {
|
||||
global
|
||||
if (PriorCompKey == d) {
|
||||
if !DeadCompose
|
||||
send {bs}
|
||||
send % val
|
||||
CompKey = 0
|
||||
isFurtherCompKey = 0
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
CheckCompUni(d,val) {
|
||||
global
|
||||
if (PriorCompKey == d) {
|
||||
if (CompKey == d) {
|
||||
PriorCompKey =
|
||||
CompKey =
|
||||
if !DeadCompose
|
||||
send {bs}
|
||||
isFurtherCompkey = 0
|
||||
SendUnicodeChar(val)
|
||||
SendUnicodeChar(val, "")
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
OutputChar(val) {
|
||||
OutputChar(val1,val2) {
|
||||
global
|
||||
if !(CheckComp(val) and DeadCompose)
|
||||
send % "{blind}" . val
|
||||
if !(CheckComp(val2) and DeadCompose)
|
||||
send % "{blind}" . val1
|
||||
}
|
||||
|
||||
OutputChar12(val1,val2) {
|
||||
OutputChar12(val1,val2,val3,val4) {
|
||||
global
|
||||
if (Ebene = 1)
|
||||
c := val1
|
||||
else c := val2
|
||||
if !(CheckComp(c) and DeadCompose)
|
||||
if (Ebene = 1)
|
||||
d := val3
|
||||
else d := val4
|
||||
if !(CheckComp(d) and DeadCompose)
|
||||
if GetKeyState("Shift","P") and isMod2Locked
|
||||
send % "{blind}{Shift Up}" . c . "{Shift Down}"
|
||||
else send % "{blind}" . c
|
||||
@ -114,20 +105,20 @@ OutputChar12(val1,val2) {
|
||||
CheckComp(d) {
|
||||
global
|
||||
if isFurtherCompkey {
|
||||
PriorCompKey := CompKey := PriorCompKey . "_" . d
|
||||
CompKey := PriorCompKey . " " . "<" . d . ">"
|
||||
isFurtherCompkey = 0
|
||||
CheckCompose()
|
||||
if (CompKey = "")
|
||||
return 1
|
||||
else CompKey =
|
||||
} else if PriorCompKey {
|
||||
PriorCompKey := CompKey := PriorCompKey . "_" . d
|
||||
CompKey := PriorCompKey . " " . "<" . d . ">"
|
||||
CheckCompose()
|
||||
if CompKey
|
||||
isFurtherCompKey = 1
|
||||
return 1
|
||||
} else if (PriorDeadKey = "comp") {
|
||||
CompKey := d
|
||||
CompKey := "<" . d . ">"
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
@ -8,21 +8,21 @@ Dieser basiert auf http://www.autohotkey.com/forum/topic32947.html
|
||||
Der Aufruf von »SubStr(charCode,3)« geht davon aus, dass alle charCodes in Hex mit führendem „0x“ angegeben sind. Die abenteuerliche „^+u“-Konstruktion benötigt im Übrigen den Hex-Wert in Kleinschrift, was derzeit nicht bei den Zeichendefinitionen umgesetzt ist, daher zentral und weniger fehlerträchtig an dieser Stelle. Außerdem ein abschließend gesendetes Space, sonst bleibt der „eingetippte“ Unicode-Wert noch kurz sichtbar stehen, bevor er sich GTK-sei-dank in das gewünschte Zeichen verwandelt.
|
||||
*/
|
||||
|
||||
SendUnicodeChar(charCode) {
|
||||
SendUnicodeChar(charCode1, charCode2) {
|
||||
|
||||
global
|
||||
if !(CheckComp(charCode) and DeadCompose)
|
||||
if !(CheckComp(charCode2) and DeadCompose)
|
||||
IfWinActive,ahk_class gdkWindowToplevel
|
||||
{
|
||||
StringLower,charCode,charCode
|
||||
send % "^+u" . SubStr(charCode,3) . " "
|
||||
StringLower,charCode1,charCode1
|
||||
send % "^+u" . SubStr(charCode1,3) . " "
|
||||
} else {
|
||||
VarSetCapacity(ki,28*2,0)
|
||||
EncodeInteger(&ki+0,1)
|
||||
EncodeInteger(&ki+6,charCode)
|
||||
EncodeInteger(&ki+6,charCode1)
|
||||
EncodeInteger(&ki+8,4)
|
||||
EncodeInteger(&ki+28,1)
|
||||
EncodeInteger(&ki+34,charCode)
|
||||
EncodeInteger(&ki+34,charCode1)
|
||||
EncodeInteger(&ki+36,4|2)
|
||||
DllCall("SendInput","UInt",2,"UInt",&ki,"Int",28)
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
Reference in New Issue
Block a user