summaryrefslogtreecommitdiffstats
path: root/windows/XP/autohotkey/neo20-remap.ahk
blob: 3e4883128a035487c22e6804c99b9bac3032bef8 (plain)
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
/*
   Mod3: Umbelegung von Win+Ctrl auf CapsLock und #,
   Mod5: Zweites AltGr auf <
   Version vom 25.05.2007
*/

;#InstallKeybdHook
#usehook on
#singleinstance force

SendMode Input ;ThenPlay - geht nicht

name = NEO-Remap
enable  = Aktiviere %name%
disable = Deaktiviere %name%


; Men� des Systray-Icons 
; ----------------------

menu, tray, nostandard
menu, tray, add, ffnen, open
menu, tray, add
menu, tray, add, %disable%, toggleneo
menu, tray, default, %disable%
menu, tray, add
menu, tray, add, Edit, edit
menu, tray, add, Reload, reload
menu, tray, add
menu, tray, add, Nicht im Systray anzeigen, hide
menu, tray, add, %name% beenden, exitprogram
menu, tray, tip, %name%



; Mod3 (3. und 4. Ebene)
; CapsLock und # werden zu Win + Ctrl
; # + CapsLock = CapsLock
; --------------------------------------------


*CapsLock::
   Send {RWin Down}
   Send {Control Down}
   GetKeyState, capsstate, #, P
   If capsstate = D  
      {
      keywait, Capslock
      GetKeyState, state, CapsLock, T 
         ; D if CapsLock is ON or U otherwise.
      if state = D
         setcapslockstate, off
      else
         setcapslockstate, on
      }
   Else 
      {
      Loop
         {
         Sleep, 10
         GetKeyState, keystate, CapsLock, P
         if keystate = U
            {
            Send {RWin Up} 
            Send {Control Up} 
            break
            }
         }
      }
return


*#::
   Send {RWin Down}
   Send {Control Down}
   Loop
   {
      Sleep, 10
      GetKeyState, keystate, #, P
      if keystate = U  
         break
   }
   Send {RWin Up} 
   Send {Control Up} 
return


; Mod5 (5. und 6. Ebene)
; < wird zu zweitem AltGr (SC138)
; < + AltGr = NumpadDot
; --------------------------------
; 

*SC138:: 
   Send {Blind}{LCtrl Up}{SC138 DownTemp}
   GetKeyState, dotstate, <, P
   If dotstate = D  
      {
      keywait, SC138
      Send {numpaddot}
      Send {Blind}{LCtrl Up}{SC138 DownTemp}
      }
   Else
      {
      Loop
         {
         Sleep, 10
         GetKeyState, keystate, SC138, P
         If keystate = U  
            {   
            Send {Blind}{SC138 Up}
            break
            }
         }
      }
return

*<::
   Send {SC138 DownTemp}
   Loop
   {
      Sleep, 10
      GetKeyState, keystate, <, P
      if keystate = U  
         break
   }
   Send {SC138 Up}
return


; Funktionen des Systray-Men�s
; ----------------------------

toggleneo:
   If suspendstate <>
   {
      suspendstate =
      menu, tray, rename, %enable%, %disable%
   }
   Else
   {
      suspendstate = : Deaktiviert
      menu, tray, rename, %disable%, %enable%
   }
   menu, tray, tip, %name%%suspendstate%
   suspend
return

open:
   ListLines ; shows the Autohotkey window
return

edit:
   edit
return

reload:
   reload
return

hide:
   menu, tray, noicon
return

exitprogram:
   exitapp
return