From 1679781006764e4c0f3e45cf5b22dbbf513c261d Mon Sep 17 00:00:00 2001 From: mösi Date: Thu, 6 Nov 2008 18:29:50 +0000 Subject: Optimierungen: • EbeneAktualisieren wird jetzt nach den Modifiern (drücken, loslassen) aufgerufen und entlastet daher die normale Tastendruck-Logik • Variablenzuweisungen und -abfragen in CharOut/Down/Up sowie in CharStarDown/Up reduziert • (derzeit) unnötige Abfrage von TK_%PhysKey% und lokale Variable ActKey in TransformKey() entfernt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.neo-layout.org@1124 b9310e46-f624-0410-8ea1-cfbb3a30dc96 --- windows/neo-vars/src/Source/recycle.ahk | 16 ++- windows/neo-vars/src/Source/varsfunctions.ahk | 137 ++++++++++++-------------- 2 files changed, 77 insertions(+), 76 deletions(-) diff --git a/windows/neo-vars/src/Source/recycle.ahk b/windows/neo-vars/src/Source/recycle.ahk index 0907255..4918128 100644 --- a/windows/neo-vars/src/Source/recycle.ahk +++ b/windows/neo-vars/src/Source/recycle.ahk @@ -3,9 +3,8 @@ ******************* */ -#MaxThreadsPerHotKey 4 +#MaxThreadsPerHotKey 1 -EbeneAktualisieren() SetBatchLines -1 SetCapsLockState Off SetNumLockState Off @@ -168,6 +167,7 @@ IsMod4RPressed := 0 IsMod4LPressed := 0 IsMod4Pressed := 0 IsMod4Locked := 0 +EbeneAktualisieren() ; die Nachfolgenden sind nützlich um sich die Qwertz-Tasten abzugewöhnen, da alle auf der 4. Ebene vorhanden. lernModus_std_Return := 0 lernModus_std_Backspace := 0 @@ -530,11 +530,13 @@ return ToggleMod2Lock() isShiftRPressed := 1 isShiftPressed := 1 + EbeneAktualisieren() return ~*VKA1SC136 up:: isShiftRPressed := 0 isShiftPressed := isShiftLPressed + EbeneAktualisieren() return ~*VKA0SC02A:: @@ -542,11 +544,13 @@ return ToggleMod2Lock() isShiftLPressed := 1 isShiftPressed := 1 + EbeneAktualisieren() return ~*VKA0SC02A up:: isShiftLPressed := 0 isShiftPressed := isShiftRPressed + EbeneAktualisieren() return ToggleMod2Lock() { @@ -569,6 +573,7 @@ ToggleMod2Lock() { CharStarDown("MOD3", "MOD3", "SComp") isMod3RPressed := 1 isMod3Pressed := 1 + EbeneAktualisieren() return *VKBFSC02B up:: @@ -576,6 +581,7 @@ return CharStarUp("MOD3") isMod3RPressed := 0 isMod3Pressed := isMod3LPressed + EbeneAktualisieren() return *VK14SC03A:: @@ -583,6 +589,7 @@ return CharStarDown("MOD3", "MOD3", "SComp") isMod3LPressed := 1 isMod3Pressed := 1 + EbeneAktualisieren() return *VK14SC03A up:: @@ -590,6 +597,7 @@ return CharStarUp("MOD3") isMod3LPressed := 0 isMod3Pressed := isMod3RPressed + EbeneAktualisieren() return ;Mod4+Mod4 == Mod4-Lock @@ -602,6 +610,7 @@ return wasMod4RPressed := isMod4RPressed isMod4RPressed := 1 isMod4Pressed := 1 + EbeneAktualisieren() if (isMod4LPressed and !wasMod4RPressed) ToggleMod4Lock() return @@ -609,12 +618,14 @@ return *VKA5SC138 up:: isMod4RPressed := 0 isMod4Pressed := isMod4LPressed + EbeneAktualisieren() return *VKE2SC056:: wasMod4LPressed := isMod4LPressed isMod4LPressed := 1 isMod4Pressed := 1 + EbeneAktualisieren() if (isMod4RPressed and !wasMod4LPressed) ToggleMod4Lock() return @@ -622,6 +633,7 @@ return *VKE2SC056 up:: isMod4LPressed := 0 isMod4Pressed := isMod4RPressed + EbeneAktualisieren() return ToggleMod4Lock() { diff --git a/windows/neo-vars/src/Source/varsfunctions.ahk b/windows/neo-vars/src/Source/varsfunctions.ahk index 021e338..58d1f38 100644 --- a/windows/neo-vars/src/Source/varsfunctions.ahk +++ b/windows/neo-vars/src/Source/varsfunctions.ahk @@ -3,7 +3,6 @@ AllStar(This_HotKey) { global PhysKey := This_HotKey - EbeneAktualisieren() if (SubStr(PhysKey,1,1) == "*") PhysKey := SubStr(PhysKey,2) if (SubStr(PhysKey,-2) == " up") { @@ -31,47 +30,52 @@ AllStar(This_HotKey) { CharStarDown(PhysKey, ActKey, char) { global - CompEntry := Comp if (PP%PhysKey% != "") - Comp := PP%PhysKey% ; resulting from key repeat + CompNew := PP%PhysKey% ; Von Tastaturwiederholung else - Comp := Comp . char ; normal compositum + CompNew := Comp . char ; Hängen wir mal das neue Zeichen zum Compositum an - tosend := "" - PP%PhysKey% := "" - - if (CD%Comp% != "") { - tosend := CD%Comp% - PP%PhysKey% := Comp + if (CD%CompNew% != "") { ; Compose hat getroffen: wird geschickt, Compose gelöscht + tosend := CD%CompNew% + PP%PhysKey% := CompNew Comp := "" - } else if (CM%Comp% != 1) { + } else if (CM%CompNew% == 1) { ; Compose muss sich noch was merken: Jetzt noch nichts schicken. + tosend := "" + PP%PhysKey% := "" + Comp := CompNew + } else if (Comp == "") { ; noch kein Zeichen in der Compose-Queue: Ein einzelnes Zeichen wird geschickt + tosend := char + PP%PhysKey% := char + } else { ; Compose hat verfehlt: nichts schicken, auch aktuelles Zeichen nicht schicken + tosend := "" + PP%PhysKey% := "" Comp := "" - if (CompEntry == "") { - tosend := char - PP%PhysKey% := char - } } - if (strlen(tosend) > 5) { ; multiple chars - if (PR%PhysKey% != "") + + + if (strlen(tosend) > 5) { ; Ausgabe mehrerer Zeichen + if (PR%PhysKey% != "") { ; Eventuell vergessenen Key-Release aufräumen CharOutUp(PR%PhysKey%) - PR%PhysKey% := "" + PR%PhysKey% := "" + } loop { - if (tosend == "") - break ; erledigt if (SubStr(tosend,1,1)=="P") { CharProc(SubStr(tosend,2,4)) } else { CharOut(SubStr(tosend,1,5)) } tosend := SubStr(tosend,6) + if (tosend == "") + break ; erledigt } - } else if (tosend != "") + } else if (tosend != "") { if (SubStr(tosend,1,1)=="P") { - if (PR%PhysKey% != "") + if (PR%PhysKey% != "") { CharOutUp(PR%PhysKey%) - PR%PhysKey% := "" + PR%PhysKey% := "" + } CharProc(SubStr(tosend,2)) } else { if ((PR%PhysKey% != "") and (PR%PhysKey% != tosend)) @@ -79,9 +83,8 @@ CharStarDown(PhysKey, ActKey, char) { PR%PhysKey% := tosend CharOutDown(tosend) } - else { - if (PR%PhysKey% != "") - CharOutUp(PR%PhysKey%) + } else if (PR%PhysKey% != "") { + CharOutUp(PR%PhysKey%) PR%PhysKey% := "" } } @@ -90,73 +93,62 @@ CharStarUp(PhysKey) { global if (PR%PhysKey% != "") { tosend := PR%PhysKey% + PR%PhysKey% := "" if (SubStr(tosend,1,1)=="P") CharProc(SubStr(tosend,2)) else CharOutUp(tosend) } - PR%PhysKey% := "" PP%PhysKey% := "" } CharOut(char) { global - if (DNCS%char% != "") { - seq := DNCS%char% . UPCS%char% - if (isShiftPressed and UNSH%char%) - seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) - send % "{blind}" . seq - } else if (CS%char% != "") { - seq := "{" . CS%char% . "}" - if (isShiftPressed and UNSH%char%) - seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) - send % "{blind}" . seq - } else + if (DNCS%char% != "") + SendBlindShiftFixed(DNCS%char% . UPCS%char%) + else if (CS%char% != "") + SendBlindShiftFixed("{" . CS%char% . "}") + else SendUnicodeChar("0x" . SubStr(char,2)) } CharOutDown(char) { global - if (DNCS%char% != "") { - seq := DNCS%char% - if (isShiftPressed and UNSH%char%) - seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) - send % "{blind}" . seq - } else if (CS%char% != "") { - seq := CS%char% - seq := "{". seq . " down}" - if (isShiftPressed and UNSH%char%) - seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) - send % "{blind}" . seq - } else + if (DNCS%char% != "") + SendBlindShiftFixed(DNCS%char%) + else if (CS%char% != "") + SendBlindShiftFixed("{" . CS%char% . " down}") + else SendUnicodeCharDown("0x" . SubStr(char,2)) } CharOutUp(char) { global if (DNCS%char% != "") { - seq := UPCS%char% - if (isShiftPressed and UNSH%char%) - seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) - send % "{blind}" . seq - } else if (CS%char% != "") { - seq := CS%char% - seq := "{". seq . " up}" - if (isShiftPressed and UNSH%char%) - seq := FixSeq(seq,isShiftLPressed,isShiftRPressed) - send % "{blind}" . seq - } else + if (UPCS%char% != "") + SendBlindShiftFixed(UPCS%char%) + } else if (CS%char% != "") + SendBlindShiftFixed("{" . CS%char% . " up}") + else SendUnicodeCharUp("0x" . SubStr(char,2)) } -FixSeq(seq,LP,RP) { - ret := seq - if (LP) - ret := "{Shift Up}" . ret . "{Shift Down}" - if (RP) - ret := "{RShift Up}" . ret . "{RShift Down}" - return ret +SendBlindShiftFixed(theseq) { + global + if (UNSH%char%) + if (IsShiftLPressed) + if (IsShiftRPressed) + send % "{blind}{RShift Up}{Shift Up}" . theseq . "{Shift Down}{RShift Down}" + else + send % "{blind}{Shift Up}" . theseq . "{Shift Down}" + else + if (IsShiftRPressed) + send % "{blind}{RShift Up}" . theseq . "{RShift Down}" + else + send % "{blind}" . theseq + else + send % "{blind}" . theseq } CharProc(subroutine) { @@ -555,11 +547,8 @@ SetFormat, Integer, hex TransformKey(PhysKey) { global if (einHandNeo and EHSpacePressed and (TKEH_%PhysKey% != "")) { - ActKey := TKEH_%PhysKey% EHKeyPressed := 1 - } else if (TK_%PhysKey% != "") - ActKey := TK_%PhysKey% - else - ActKey := PhysKey - return ActKey + return TKEH_%PhysKey% + } + return PhysKey } -- cgit v1.2.3