Configure Telegram Hotkeys with AutoHotkey
Goal
Recently while organizing hotkeys, I wanted to set Ctrl
+ Alt
+ T
to toggle the Telegram window, but couldn't find this option in Telegram's settings or in the Telegram Official Shortcuts List.
After searching, I found someone on Appinn Forum suggesting the use of AutoHotkey.
AHK v2 Script
The code provided by the user on Appinn Forum uses AHK v1 syntax, but since AutoHotkey v1 is deprecated, I needed to rewrite the script using v2 documentation.
Related AHK Documentation
Using ChatGPT and the official manual, I wrote an AHK v2 script.
telegram.ahk
:
^!t::
{
if WinExist("ahk_exe Telegram.exe") {
WinClose("ahk_exe Telegram.exe")
} else {
Run "C:\Users\salt\AppData\Roaming\Telegram Desktop\Telegram.exe"
}
return
}
Replace
C:\Users\salt\AppData\Roaming\Telegram Desktop\Telegram.exe
with your own Telegram path.
Usage
- Download and install AutoHotkey v2
Win
+R
→%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
- Place the
telegram.ahk
script here
This way, telegram.ahk
will run automatically at startup.