Hotkey in Minecraft but not when chatting Topic is solved

Ask gaming related questions (AHK v1.1 and older)
folkefilbytor
Posts: 2
Joined: 07 Dec 2021, 16:09

Hotkey in Minecraft but not when chatting

07 Dec 2021, 16:22

Hi!

I managed to write this code so Minecraft thinks I press LShift when I press n. And it worked perfect until I wanted to chat with my friends... Is it possible to make it so that it only applies when I'm not in the chat? So when I press T (open chat), it deactivates and when I press Enter (send message) it activates again.

This is my code so far:

Code: Select all

GroupAdd, Minecraft, Minecraft
GroupAdd, Minecraft, ahk_exe javaw.exe

#IfWinActive, Minecraft ahk_exe javaw.exe

n::LShift
return
Thankfull for any help :)
User avatar
mikeyww
Posts: 26871
Joined: 09 Sep 2014, 18:38

Re: Hotkey in Minecraft but not when chatting

07 Dec 2021, 19:32

Code: Select all

winTitle = Minecraft ahk_exe javaw.exe

#If WinActive(winTitle) && active
n::LShift

#If WinActive(winTitle)
~Enter::
active := True
SoundBeep, 1500
Return

~t::
active := False
SoundBeep, 1000
Return
#If
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Hotkey in Minecraft but not when chatting  Topic is solved

07 Dec 2021, 19:37

Give this a try:

Code: Select all

GroupAdd, Minecraft, Minecraft
GroupAdd, Minecraft, ahk_exe javaw.exe

#IfWinActive, ahk_group Minecraft    ; You probably intended to use ahk_group

n::LShift

~t::
    Suspend, Permit
    Suspend, On
return

~Enter::Suspend, Off

#IfWinActive
folkefilbytor
Posts: 2
Joined: 07 Dec 2021, 16:09

Re: Hotkey in Minecraft but not when chatting

08 Dec 2021, 02:21

Thank you for the quick help! Worked perfectly :D

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 59 guests