From 60a6cb07a1d7ec5190fff20f3adfd7dd65dc4179 Mon Sep 17 00:00:00 2001 From: TheBestPessimist Date: Tue, 19 Nov 2024 11:21:28 +0200 Subject: [PATCH] Fucking Slack has dogshit slow garbage performance --- app_handling.ahk | 14 ++++++++++++++ hotstrings/GenericHotstrings.ahk | 22 +++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/app_handling.ahk b/app_handling.ahk index 7e3c281..3e61820 100644 --- a/app_handling.ahk +++ b/app_handling.ahk @@ -232,6 +232,20 @@ K::Send "{RButton}" +/* +Why a KeyDelay for Slack? Because Slack has dogshit slow garbage performance. + +If i use normal hotstring replacement for text which has any markup (italic, bold, inline code, etc.), Slack trashes everything ahk types and also losses characters. +Instead, I have to use SendEvent, which respects key delay. + +I swear to fucking god, all the JavaScript world is pure fucking garbage. +*/ +if(WinActive("ahk_exe slack.exe")) { + SetKeyDelay 100 +} + + + ;$q::Send "1q" ;$w::Send "1w" ;$e::Send "1e" diff --git a/hotstrings/GenericHotstrings.ahk b/hotstrings/GenericHotstrings.ahk index f0dc399..457bea5 100644 --- a/hotstrings/GenericHotstrings.ahk +++ b/hotstrings/GenericHotstrings.ahk @@ -1,8 +1,12 @@ -; Reference: https://autohotkey.com/docs/Hotstrings.htm#Options -; Flag explanations: -; - 0 (letter o) deletes the ending character (the one which activates the hotstring) -; - B0 (letter b and zero): Disable automatic backspacing -; - Kn: Delay between each keypress +/* +Reference: https://autohotkey.com/docs/Hotstrings.htm#Options +Flag explanations: +- 0 (letter o) deletes the ending character (the one which activates the hotstring) +- B0 (letter b and zero): Disable automatic backspacing +- Kn: Delay between each keypress + +Why am I using SendEvent at times? Search for Slack. +*/ ; ----- @self -------------------------- :O:c@tbp::cristian@tbp.land @@ -58,9 +62,13 @@ ; ---- Misc ---------------------------- -::.giggle::__(giggle)__ +::.giggle::{ + SendEvent("__(giggle)__") +} -::.logo::`¯\_(ツ)_/¯` +::.logo::{ + SendEvent("``¯\_(ツ)_/¯``") +} ::.youtried::https://discourse.tbp.land/uploads/default/original/1X/ffe6c3aeef608606b00fa5587acce5bbf6d15d05.png