Skip to content

Commit 30526bd

Browse files
v1.2.2: Enhance UI readability and align variables
1 parent 2b44d0d commit 30526bd

File tree

4 files changed

+85
-79
lines changed

4 files changed

+85
-79
lines changed

AI-Hotkeys-de.ini

-56 Bytes
Binary file not shown.

AI-Hotkeys.ahk

+65-59
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;;;;;;;;;;;;;;;;;;
2-
; AI-Hotkeys.ahk ; Version 1.2.1.20241007 - Copyright (C) 2024 Wolfram Ravenwolf
2+
; AI-Hotkeys.ahk ; Version 1.2.2.20241007 - Copyright (C) 2024 Wolfram Ravenwolf
33
;;;;;;;;;;;;;;;;;;
44

55
; This program is free software: you can redistribute it and/or modify
@@ -64,12 +64,12 @@ global F1 := "Formulate the following text better"
6464
global F2 := "Improve grammar, spelling, style, tone, and comprehensibility. Maintain the language and level of formality. Write only the improved version, nothing else. KEEP THE ORIGINAL LANGUAGE OF THE TEXT (E.G. ENGLISH OR GERMAN)!"
6565
global FF := "writing"
6666

67-
global G0 := "Check grammar, spelling, etc."
67+
global G0 := "Check grammar etc."
6868
global G1 := "Check grammar, spelling, style, tone, and comprehensibility of the following text"
6969
global G2 := "Provide specific suggestions for improvement and explain them to me. KEEP THE ORIGINAL LANGUAGE OF THE TEXT (E.G. ENGLISH OR GERMAN)!"
7070
global GF := "writing"
7171

72-
global Q0 := "Query"
72+
global Q0 := "Query Perplexity…"
7373
global Q1 := ""
7474
global Q2 := ""
7575
global QF := ""
@@ -142,62 +142,62 @@ if (Language = "de") {
142142
; Default (German) Tasks and Writing Instructions
143143
; ------------------------------------------------------------------------------
144144

145-
global A0 := "Antwort"
145+
global A0 := "Verfasse Antwort"
146146
global A1 := "Verfasse eine Antwort auf folgenden Text"
147147
global A2 := "Antworte in meinem Namen. Behalte Sprache und Formalitätsgrad bei. Schreibe nur die Antwort, sonst nichts. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
148148
global AF := "writing"
149149

150-
global B0 := "Berechnen/Konvertieren"
150+
global B0 := "Berechne/Konvertiere"
151151
global B1 := "Berechne/Konvertiere und erkläre"
152152
global B2 := ""
153153
global BF := ""
154154

155-
global C0 := "Richtigkeit prüfen"
155+
global C0 := "Prüfe Richtigkeit"
156156
global C1 := "Prüfe die Richtigkeit und begründe deine Einschätzung"
157157
global C2 := ""
158158
global CF := ""
159159

160-
global D0 := "Definieren"
160+
global D0 := "Definiere"
161161
global D1 := "Definiere"
162162
global D2 := ""
163163
global DF := ""
164164

165-
global E0 := "Erklären"
165+
global E0 := "Erkläre"
166166
global E1 := "Erkläre einfach und leicht verständlich"
167167
global E2 := ""
168168
global EF := ""
169169

170-
global F0 := "Formulieren verbessern"
170+
global F0 := "Formuliere besser"
171171
global F1 := "Formuliere folgenden Text besser"
172172
global F2 := "Verbessere Grammatik, Rechtschreibung, Stil, Ton und Verständlichkeit. Behalte Sprache und Formalitätsgrad bei. Schreibe nur die verbesserte Fassung, sonst nichts. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
173173
global FF := "writing"
174174

175-
global G0 := "Grammatik, Rechtschreibung etc. prüfen"
175+
global G0 := "Prüfe Grammatik usw."
176176
global G1 := "Prüfe Grammatik, Rechtschreibung, Stil, Ton und Verständlichkeit des folgenden Textes"
177177
global G2 := "Gib mir konkrete Verbesserungsvorschläge und erläutere sie mir. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
178178
global GF := "writing"
179179

180-
global Q0 := "Anfrage"
180+
global Q0 := "Perplexity…"
181181
global Q1 := ""
182182
global Q2 := ""
183183
global QF := ""
184184

185-
global R0 := "Recherchieren"
185+
global R0 := "Recherchiere"
186186
global R1 := "Recherchiere zu folgendem Thema"
187187
global R2 := ""
188188
global RF := ""
189189

190-
global S0 := "Zusammenfassen"
190+
global S0 := "Fasse zusammen"
191191
global S1 := "Fasse zusammen"
192192
global S2 := ""
193193
global SF := ""
194194

195-
global T0 := "Übersetzen"
195+
global T0 := "Übersetze"
196196
global T1 := "Übersetze den folgenden Text ins Deutsche oder aus dem Deutschen"
197197
global T2 := "Liefere nur die Übersetzung. Behalte die ursprüngliche Formatierung und Struktur bei. ÜBERSETZE ZWISCHEN DEUTSCH UND ENGLISCH, ES SEI DENN, EINE ANDERE SPRACHE WIRD AUSDRÜCKLICH GEWÜNSCHT."
198198
global TF := "writing"
199199

200-
global V0 := "Verdeutlichen/Vereinfachen"
200+
global V0 := "Verdeutliche/Vereinfache"
201201
global V1 := "Verdeutliche und vereinfache folgenden Text sprachlich"
202202
global V2 := "Schreibe nur die verdeutlichte und vereinfachte Fassung, sonst nichts. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
203203
global VF := "writing"
@@ -207,14 +207,14 @@ global W1 := "Was ist"
207207
global W2 := ""
208208
global WF := ""
209209

210-
global X0 := "Absagen"
210+
global X0 := "Verfasse Absage"
211211
global X1 := "Verfasse eine verneinende/ablehnende Antwort/Absage auf folgenden Text"
212212
global X2 := "Antworte in meinem Namen. Behalte Sprache und Formalitätsgrad bei. Schreibe nur die Absage, sonst nichts. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
213213
global XF := "writing"
214214

215215
global YorZ := "Y"
216216

217-
global Y0 := "Zusagen"
217+
global Y0 := "Verfasse Zusage"
218218
global Y1 := "Verfasse eine bejahende/zustimmende Antwort/Zusage auf folgenden Text"
219219
global Y2 := "Antworte in meinem Namen. Behalte Sprache und Formalitätsgrad bei. Schreibe nur die Zusage, sonst nichts. BEHALTE DIE ORIGINAL-SPRACHE DES TEXTS (Z. B. DEUTSCH ODER ENGLISCH) BEI!"
220220
global YF := "writing"
@@ -265,19 +265,19 @@ LoadCustomVariables()
265265
; ------------------------------------------------------------------------------
266266

267267
if (WinHotkey_Perplexity) {
268-
Hotkey, #%WinHotkey_Perplexity%, Perplexity_Hotkey ; Win+Q (by default)
268+
Hotkey, #%WinHotkey_Perplexity%, Perplexity_Hotkey ; Default: Win+Q
269269
}
270270
if (WinHotkey_Dictionary) {
271-
Hotkey, #%WinHotkey_Dictionary%, Dictionary_Hotkey ; Win+B (by default)
271+
Hotkey, #%WinHotkey_Dictionary%, Dictionary_Hotkey ; Default: Win+B
272272
}
273273
if (WinHotkey_Google) {
274-
Hotkey, #%WinHotkey_Google%, Google_Hotkey ; Win+G (by default) ⚠️ Remove Game Bar: Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage
274+
Hotkey, #%WinHotkey_Google%, Google_Hotkey ; Default: Win+G ⚠️ Remove Game Bar: Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage
275275
}
276276
if (WinHotkey_Translator) {
277-
Hotkey, #%WinHotkey_Translator%, Translator_Hotkey ; Win+T (by default)
277+
Hotkey, #%WinHotkey_Translator%, Translator_Hotkey ; Default: Win+T
278278
}
279279
if (WinHotkey_Wikipedia) {
280-
Hotkey, #%WinHotkey_Wikipedia%, Wikipedia_Hotkey ; Win+W (by default)
280+
Hotkey, #%WinHotkey_Wikipedia%, Wikipedia_Hotkey ; Default: Win+W
281281
}
282282

283283

@@ -406,8 +406,12 @@ UrlEncode(str) {
406406
; AI (Perplexity)
407407
; ------------------------------------------------------------------------------
408408

409-
AI(Task := "", Instructions := "", Focus := "")
409+
AI(hotkey)
410410
{
411+
task := %hotkey%1
412+
instructions := %hotkey%2
413+
focus := %hotkey%F
414+
411415
url := URL_PERPLEXITY
412416

413417
ClipboardOld := ClipboardAll
@@ -424,14 +428,14 @@ AI(Task := "", Instructions := "", Focus := "")
424428
if (PREFIX != "")
425429
prompt .= PREFIX . "`n`n"
426430

427-
if (Task)
431+
if (task != "")
428432
{
429-
prompt .= Task . ":`n`n"
430-
if (Instructions)
433+
prompt .= task . ":`n`n"
434+
if (instructions != "")
431435
prompt .= "<text>`n"
432436
prompt .= Clipboard
433-
if (Instructions)
434-
prompt .= "`n</text>`n`n" . Instructions
437+
if (instructions != "")
438+
prompt .= "`n</text>`n`n" . instructions
435439
}
436440
else
437441
prompt .= Clipboard
@@ -441,10 +445,10 @@ AI(Task := "", Instructions := "", Focus := "")
441445

442446
url .= "search?"
443447

444-
if (Focus != "")
445-
url .= "focus=" . Focus . "&"
448+
if (focus != "")
449+
url .= "focus=" . focus . "&"
446450

447-
if (Pro = "1" || Pro = "true" || (Pro = "auto" && Focus != "writing"))
451+
if (Pro = "1" || Pro = "true" || (Pro = "auto" && focus != "writing"))
448452
url .= "pro=true&"
449453

450454
url .= "q=" . UrlEncode(prompt)
@@ -530,24 +534,24 @@ SetCapsLockState, AlwaysOff
530534
; AI (Perplexity)
531535
; ------------------------------------------------------------------------------
532536

533-
SC03A & a::AI(A1, A2, AF)
534-
SC03A & b::AI(B1, B2, BF)
535-
SC03A & c::AI(C1, C2, CF)
536-
SC03A & d::AI(D1, D2, DF)
537-
SC03A & e::AI(E1, E2, EF)
538-
SC03A & f::AI(F1, F2, FF)
539-
SC03A & g::AI(G1, G2, GF)
540-
SC03A & q::AI(Q1, Q2, QF)
541-
SC03A & r::AI(R1, R2, RF)
542-
SC03A & s::AI(S1, S2, SF)
543-
SC03A & t::AI(T1, T2, TF)
544-
SC03A & v::AI(V1, V2, VF)
545-
SC03A & w::AI(W1, W2, WF)
546-
SC03A & x::AI(X1, X2, XF)
537+
SC03A & a::AI("A")
538+
SC03A & b::AI("B")
539+
SC03A & c::AI("C")
540+
SC03A & d::AI("D")
541+
SC03A & e::AI("E")
542+
SC03A & f::AI("F")
543+
SC03A & g::AI("G")
544+
SC03A & q::AI("Q")
545+
SC03A & r::AI("R")
546+
SC03A & s::AI("S")
547+
SC03A & t::AI("T")
548+
SC03A & v::AI("V")
549+
SC03A & w::AI("W")
550+
SC03A & x::AI("X")
547551
#If (CapsLockHotkeys and YorZ = "Y")
548-
SC03A & y::AI(Y1, Y2, YF)
552+
SC03A & y::AI("Y")
549553
#If (CapsLockHotkeys and YorZ = "Z")
550-
SC03A & z::AI(Z1, Z2, ZF)
554+
SC03A & z::AI("Z")
551555

552556
#If
553557

@@ -638,17 +642,19 @@ UseDarkTheme() {
638642
Gui, +LastFound
639643
WinSet, Transparent, 245
640644
}
645+
Gui, Font, s12 ; Set font size to 12
641646
Gui, Add, Edit, hwndClipboardEdit vClipboard w620 h340, %Clipboard%
647+
Gui, Font, s8 ; Set font size back to 8 (default)
642648
Loop, 15 {
643-
ButtonLetter := SubStr("QWERTASDFG" . YorZ . "XCVB", A_Index, 1)
644-
Gui, Add, Button, hwnd%ButtonLetter%Btn g%ButtonLetter%Action Left, % " &" . ButtonLetter . ": " . %ButtonLetter%0
649+
Hotkey := SubStr("QWERTASDFG" . YorZ . "XCVB", A_Index, 1)
650+
Gui, Add, Button, hwnd%Hotkey%Btn g%Hotkey%Action Left, % " &" . Hotkey . ": " . %Hotkey%0
645651
}
646652
Gui, Add, Button, hwndSaveBtn gSaveClipboard, ✔️ Save (LWin+LAlt)
647653
Gui, Add, Button, hwndClearBtn gClearClipboard, 🧹 Clear (Alt+Del)
648654
Gui, Add, Button, hwndRestoreBtn gRestoreClipboard, 🔄 Restore (Alt+Ins)
649655
Gui, Add, Button, hwndExitBtn gGuiClose, ❌ Exit (Esc)
650656
Gui, +Resize
651-
Gui, Show, w640 h480, AI-Hotkeys Clipboard Editor
657+
Gui, Show, w800 h600, AI-Hotkeys Clipboard Editor ; 800x600
652658
OnMessage(0x0005, "GuiSize") ; WM_SIZE message
653659

654660
; Center window on active monitor
@@ -670,7 +676,7 @@ GuiSize:
670676
;MsgBox, GuiSize
671677
if (A_EventInfo == 1) ; The window has been minimized. No action needed.
672678
return
673-
NewWidth := A_GuiWidth - 20
679+
NewWidth := A_GuiWidth - 30 ; Adjusted to account for font size 12
674680
NewHeight := A_GuiHeight - 140 ; Adjusted to account for action button rows
675681
GuiControl, Move, %ClipboardEdit%, w%NewWidth% h%NewHeight%
676682

@@ -686,12 +692,12 @@ GuiSize:
686692
ButtonWidth := TotalButtonWidth // 5 ; Divide available width by 5 for each button
687693
Loop, 5 {
688694
ButtonX := Margin + (A_Index - 1) * (ButtonWidth + ButtonSpacing)
689-
ButtonLetter1 := SubStr("QWERT", A_Index, 1)
690-
ButtonLetter2 := SubStr("ASDFG", A_Index, 1)
691-
ButtonLetter3 := SubStr(YorZ . "XCVB", A_Index, 1)
692-
GuiControl, Move, % %ButtonLetter1%Btn, x%ButtonX% y%RowY1% w%ButtonWidth%
693-
GuiControl, Move, % %ButtonLetter2%Btn, x%ButtonX% y%RowY2% w%ButtonWidth%
694-
GuiControl, Move, % %ButtonLetter3%Btn, x%ButtonX% y%RowY3% w%ButtonWidth%
695+
Hotkey1 := SubStr("QWERT", A_Index, 1)
696+
Hotkey2 := SubStr("ASDFG", A_Index, 1)
697+
Hotkey3 := SubStr(YorZ . "XCVB", A_Index, 1)
698+
GuiControl, Move, % %Hotkey1%Btn, x%ButtonX% y%RowY1% w%ButtonWidth%
699+
GuiControl, Move, % %Hotkey2%Btn, x%ButtonX% y%RowY2% w%ButtonWidth%
700+
GuiControl, Move, % %Hotkey3%Btn, x%ButtonX% y%RowY3% w%ButtonWidth%
695701
}
696702

697703
; Calculate position for the main action button row
@@ -749,8 +755,8 @@ XAction:
749755
YAction:
750756
ZAction:
751757
Gui, Submit, NoHide
752-
action := SubStr(A_ThisLabel, 1, 1)
753-
AI(%action%1, %action%2, %action%F)
758+
hotkey := SubStr(A_ThisLabel, 1, 1)
759+
AI(hotkey)
754760
Gui, Destroy
755761
return
756762

AI-Hotkeys.ini

-12 Bytes
Binary file not shown.

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,23 @@ While the various prompts are optimized for their respective tasks, they can be
9595
9696
![AI-Hotkeys-de](AI-Hotkeys-de.png)
9797
98-
| Hotkey | 🇺🇸 Action | 🇩🇪 Aktion |
99-
| -------------- | ----------------------------- | ------------------------------------- |
100-
| CapsLock + A | Answer | Verfasse eine Antwort |
101-
| CapsLock + B | Calculate/Convert | Berechne/Konvertiere |
102-
| CapsLock + C | Check correctness | Prüfe Richtigkeit |
103-
| CapsLock + D | Define | Definiere |
104-
| CapsLock + E | Explain | Erkläre |
105-
| CapsLock + F | Formulate better | Formuliere besser |
106-
| CapsLock + G | Check grammar, spelling, etc. | Prüfe Grammatik, Rechtschreibung usw. |
107-
| CapsLock + Q | Query | Anfrage |
108-
| CapsLock + R | Research | Recherchiere |
109-
| CapsLock + S | Summarize | Fasse zusammen |
110-
| CapsLock + T | Translate | Übersetze |
111-
| CapsLock + V | Clarify/Simplify | Verdeutliche/Vereinfache |
112-
| CapsLock + W | What is | Was ist |
113-
| CapsLock + X | Reject | Verfasse eine Absage |
114-
| CapsLock + Y/Z | Accept | Verfasse eine Zusage |
98+
| Hotkey | 🇺🇸 Action | 🇩🇪 Aktion |
99+
| -------------- | ------------------ | ------------------------ |
100+
| CapsLock + A | Answer | Verfasse Antwort |
101+
| CapsLock + B | Calculate/Convert | Berechne/Konvertiere |
102+
| CapsLock + C | Check correctness | Prüfe Richtigkeit |
103+
| CapsLock + D | Define | Definiere |
104+
| CapsLock + E | Explain | Erkläre |
105+
| CapsLock + F | Formulate better | Formuliere besser |
106+
| CapsLock + G | Check grammar etc. | Prüfe Grammatik usw. |
107+
| CapsLock + Q | Query Perplexity… | Perplexity… |
108+
| CapsLock + R | Research | Recherchiere |
109+
| CapsLock + S | Summarize | Fasse zusammen |
110+
| CapsLock + T | Translate | Übersetze |
111+
| CapsLock + V | Clarify/Simplify | Verdeutliche/Vereinfache |
112+
| CapsLock + W | What is | Was ist |
113+
| CapsLock + X | Reject | Verfasse Absage |
114+
| CapsLock + Y/Z | Accept | Verfasse Zusage |
115115
116116
These shortcuts make it easy to access AI assistance for various tasks throughout your Windows environment. Remember the shortcuts work everywhere in Windows, so you can use them in any application, including web and file browsers, text editors, office software, email clients, chat programs, and more.
117117
@@ -134,7 +134,7 @@ Here's a detailed overview of each shortcut with some tips on how to use them mo
134134
- **Research (CapsLock + R)** for a detailed report
135135
- **What is (CapsLock + W)** for a quick answer
136136
137-
- Writing anything important? Use **Clarify (CapsLock + V)** to ask the AI to clarify a sentence, simplify it, or improve it in other ways. Get advice on grammar, spelling, style, tone, and comprehensibility with **Check grammar, spelling, etc. (CapsLock + G)**. Or simply use **Formulate better (CapsLock + F)** if you want to effortlessly improve an entire text at once.
137+
- Writing anything important? Use **Clarify (CapsLock + V)** to ask the AI to clarify a sentence, simplify it, or improve it in other ways. Get advice on grammar, spelling, style, tone, and comprehensibility with **Check grammar etc. (CapsLock + G)**. Or simply use **Formulate better (CapsLock + F)** if you want to effortlessly improve an entire text at once.
138138
139139
Alternatively, use **DeepL Translate (Win + T)** for even more powerful translation capabilities.
140140
@@ -144,7 +144,7 @@ Here's a detailed overview of each shortcut with some tips on how to use them mo
144144

145145
- **What is (CapsLock + W)** is a very versatile shortcut that can be used in many different contexts. Any term or concept you don't know can be looked up with it instantly. But it's not limited to just text, it can also be used to get information about files, URLs, etc. For example, select a file in Windows Explorer (such as an old download with a cryptic name that has long been forgotten in the Downloads folder, or an obscure system file with an unkown purpose) and use **What is** to get information about it. The AI analyzes only the file name and path - the file content is NEVER uploaded or accessed! Despite this limitation, the insights provided are often surprisingly accurate and informative.
146146

147-
- Any other task not covered by the hotkeys above? Use **Query (CapsLock + Q)** to ask Perplexity in your own words, by sending only what text you've selected or the content of your clipboard.
147+
- Any other task not covered by the hotkeys above? Use **Query Perplexity… (CapsLock + Q)** to ask Perplexity in your own words, by sending only what text you've selected or the content of your clipboard.
148148
149149
Additionally, there are some Windows hotkeys for quick searches and lookups:
150150
@@ -197,7 +197,7 @@ When the Clipboard Editor is open, you can use the following hotkeys:
197197
- **Alt + Delete**: Clear
198198
- **Alt + Insert**: Restore
199199
- **Esc**: Exit
200-
- **Alt + Q** or **Ctrl + Enter**: Query (Perplexity)
200+
- **Alt + Q** or **Ctrl + Enter**: Query Perplexity
201201

202202
The Clipboard Editor provides a convenient way to modify your text before sending it to AI services, allowing for more precise queries and edits.
203203

0 commit comments

Comments
 (0)