Permalink
Browse files

Fixed/updated disabling Texter through keyboard shortcut or right-cli…

…ck menu
  • Loading branch information...
1 parent 5a6d8f8 commit b5f7bb03bbcf7066260b661d6dfcffb95cddc6e2 adam committed Sep 27, 2007
Showing with 26 additions and 7 deletions.
  1. +6 −0 includes/GUI/preferences_GUI.ahk
  2. +6 −3 includes/functions/disable.ahk
  3. +14 −4 texter.ahk
@@ -74,6 +74,12 @@ If (smanagehotkey != managehotkey)
IniWrite,%managehotkey%,texter.ini,Hotkey,Management
}
IniWrite,%disablehotkey%,texter.ini,Hotkey,Disable
+if disablehotkey <>
+{
+ Hotkey,IfWinNotActive,Texter Preferences
+ Hotkey,%disablehotkey%,DISABLE
+ Hotkey,IfWinActive
+}
;code optimization -- calculate MODE from ModeGroup
MODE := ModeGroup - 1
IniWrite,%MODE%,texter.ini,Settings,Mode
@@ -1,15 +1,18 @@
DISABLE:
IniRead,disable,texter.ini,Settings,Disable
-if disable = 0
+if Disable = 0
{
IniWrite,1,texter.ini,Settings,Disable
- EnableTriggers(false)
+; EnableTriggers(false)
Menu,Tray,Check,&Disable
+ Disable = 1
+ Send,{%SpecialKey%}
}
else
{
IniWrite,0,texter.ini,Settings,Disable
- EnableTriggers(true)
+; EnableTriggers(true)
Menu,Tray,Uncheck,&Disable
+ Disable = 0
}
return
View
@@ -38,10 +38,18 @@ SetTimer, MonitorWindows, 500
Loop
{
;wait for a matching hotstring
- if Search <>
+ if (Disable = 1)
+ {
+ continue
+ }
+ if Starting <>
{
Loop
{ ;grab input one character at a time looking for a match
+ if (Disable = 1)
+ {
+ break
+ }
Input, UserInput, L1 V, %EndKeys%
;Tooltip, Input received, 10, 10
if (SubStr(ErrorLevel, 1, 6) = "EndKey")
@@ -125,13 +133,13 @@ Loop
PossibleMatch=
PossHexMatch=
Match=
- Search=0
+ Starting=1
}
else
{
PossibleMatch=%PossibleMatch%%UserInput%
SendInput, %UserInput%
- Search=
+ Starting=
}
}
return
@@ -308,7 +316,9 @@ ReplaceWAV = %A_ScriptDir%\resources\replace.wav
TexterPNG = %A_ScriptDir%\resources\texter.png
TexterICO = %A_ScriptDir%\resources\texter.ico
StyleCSS = %A_ScriptDir%\resources\style.css
-EndKeys={Enter}{Esc} {Tab}{Right}{Left}{Up}{Down}{Del}{BS}{Home}{End}{PgUp}{PgDn}{SC77}
+SpecialKey = SC77
+EndKeys={Enter}{Esc} {Tab}{Right}{Left}{Up}{Down}{Del}{BS}{Home}{End}{PgUp}{PgDn}{%SpecialKey%}
+Disable = 0
return
READINI:

0 comments on commit b5f7bb0

Please sign in to comment.