View difference between Paste ID: vNVz8zQ9 and uuaDKNXu
SHOW: | | - or go back to the newest paste.
1
;;;;;;;;;;;; BEGIN SCRIPT 2
2
3
DetectHiddenWindows, On
4
SetWinDelay, -1
5
SetKeyDelay, -1
6
SetBatchLines, -1
7
GoSub Remin
8
SetTimer, Remin, % 1000 * 60
9
10
GoSub popupMenuScriptStartup
11
12
Loop, read, %A_ScriptDir%\keywords.ini
13
{
14
   LineNumber = %A_Index%
15
   Loop, parse, A_LoopReadLine, |
16
    {
17
   if (A_Index == 1)
18
      abbrevs%LineNumber% := A_LoopField
19
   else if (A_Index == 2)
20
      tips%LineNumber% := A_LoopField
21
   else if (A_Index == 3)
22
      programs%LineNumber% := A_LoopField
23
   else if (A_Index == 4)
24
      params%LineNumber% := A_LoopField
25
    }
26
   tosay := abbrevs%LineNumber%
27
}
28
cnt = %LineNumber%
29
30
Loop   {
31
   Input, Key, L1 V, % "{LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}"
32
  . "{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}"
33
  . "{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause}{Escape}"
34
35
   If( ( Asc(Key) >= 65 && Asc(Key) <= 90 ) || ( Asc(Key) >= 97 && Asc(Key) <= 122 ) )
36
      Word .= Key
37
   Else
38
   {
39
      Word := ""
40
      Continue
41
   }
42
   tipup := false
43
   Loop %cnt%
44
   {
45
46
      if (Word == abbrevs%A_index%)
47
      {
48
         tip := tips%A_index%
49
         ToolTip %tip%
50
         tipup := true
51
          }
52
         else
53
          {
54
         if (tipup == false)
55
         ToolTip
56
      }
57
   }
58
}
59
60
$Tab::
61
   Loop %cnt%
62
   {
63
      if (Word != "" && Word == abbrevs%A_index%)
64
      {
65
         Word := ""
66
       
67
         StringLen, len, abbrevs%A_index%
68
         Loop %len%
69
            Send {Shift Down}{Left}
70
         Send {Shift Up}{BS}
71
       
72
      ToolTip
73
      program := programs%A_index%
74
      param := params%A_index%
75
      run, %program% %param%
76
      return
77
      }
78
   }
79
   Word := ""
80
   Send {Tab}
81
Return
82
83
~LButton::
84
~MButton::
85
~RButton::
86
~XButton1::
87
~XButton2::
88
   Word := ""
89
   Tooltip
90
Return
91
92
Remin:
93
94
WinMinimize, %A_ScriptFullPath% - AutoHotkey v
95
WinHide, %A_ScriptFullPath% - AutoHotkey v
96
Return
97
98
;;;;;;;;;; END SCRIPT 2
99
100
101
;;;;;;;;;;;;;; BEGIN SCRIPT 1
102
popupMenuScriptStartup:
103
;This is a working script that creates a popup menu.
104
105
; Create the popup menu by adding some items to it.
106
Menu, MyMenu, Add, FIS 201, MenuHandler
107
Menu, MyMenu, Add  ; Add a separator line.
108
Menu, MyMenu, Color, Lime, Single ;Define the Menu Color
109
110
111
; Create another menu destined to become a submenu of the above menu.
112
Menu, Submenu1, Add, Item2, MenuHandler
113
Menu, Submenu1, Add, Item3, MenuHandler
114
Menu, Submenu1, Color, Yellow ;Define the Menu Color
115
116
117
; Create another menu destined to become a submenu of the above menu.
118
Menu, Submenu2, Add, Item1a, MenuHandler
119
Menu, Submenu2, Add, Item2a, MenuHandler
120
Menu, Submenu2, Add, Item3a, MenuHandler
121
Menu, Submenu2, Add, Item4a, MenuHandler
122
Menu, Submenu2, Add, Item5a, MenuHandler
123
Menu, Submenu2, Add, Item6a, MenuHandler
124
Menu, Submenu2, Color, Aqua ;Define the Menu Color
125
126
127
; Create a submenu in the first menu (a right-arrow indicator). When the user selects it, the second menu is displayed.
128
Menu, MyMenu, Add, BKRS 119, :Submenu1
129
Menu, MyMenu, Add  ; Add a separator line below the submenu.
130
Menu, MyMenu, Add, BKRS 201, :Submenu2
131
Menu, MyMenu, Add  ; Add a separator line below the submenu.
132
133
Menu, MyMenu, Add  ; Add a separator line below the submenu.
134-
return  ; End of script's auto-execute section.
134+
135
136
return  ; End of popupMenuScriptStartup
137
138
Capslock & LButton::Menu, MyMenu, Show  ; i.e. press the Win-Z hotkey to show the menu.
139
140
MenuHandler:
141
MsgBox You selected %A_ThisMenuItem% from the menu %A_ThisMenu%.
142
return
143
144
;;;;;;;;;;;;;;;;;;;;;;;;
145
146
;;;;;;;; Google Search
147
;;; FORMAT InputBox, OutputVar [, Title, Prompt, HIDE, Width, Height, X, Y, Font, Timeout, Default]
148
Google:
149
InputBox, SearchTerm, Google Search,,,350, 120
150
if SearchTerm <> ""
151
Run http://www.google.de/search?sclient=psy-ab&hl=de&site=&source=hp&q=%SearchTerm%&btnG=Suche
152
153
return
154
155
; Make Window Transparent
156
#Space::WinSet, Transparent, 125, A
157
^!Space UP::WinSet, Transparent, OFF, A
158
return
159
160
;;;;;;;;;;;; END SCRIPT 1