I use my Logitech G15 G keys macros to press ², type TM, press enter and press ² again. With a 80ms delay during keypress. Any other macro program could probably do the same.
Not sure if this helps, but it's one approach...
OK, I tried something like that, but can't get the tilde key to register in-game, short of pressing it myself on the keyboard. If I press the tilde, the macro will simulate t,m, and Enter for me, then I have to press tilde again. I've tried recording a regular press of the tilde key and SHIFT+tilde, but neither works. The rest of the macro works fine without any delays, or with delays (just slower).
When you say to "press ²," what do you mean? Is there something I can record other than tilde to do the same thing?
Since I have a G400, I assume I'm using the same Logitech Gaming Software as you.