Quantcast
Disabling left click and right click on the chat edit box. - WoWInterface
Thread Tools Display Modes
07-15-20, 06:27 PM   #1
HolyAA
A Defias Bandit
Join Date: Jul 2020
Posts: 2
Disabling left click and right click on the chat edit box.

Hello there !

I've been writing my own UI last month to get rid of many addons. But here's my final boss.



I was set up like this before and got used by my edit box at center of the screen.
But sometimes i accidentally click on this space of the screen, opening chat box and writing "qqqqqqqqqqqqqqqdddddddddq" while being in raid. I'm looking for a way to disable clicking to open my edit chatbox and just using enter to do it.

I've been looking into this : https://github.com/Gethe/wow-ui-sour.../ChatFrame.lua

Found :

function ChatFrame_OpenChat(text, chatFrame, desiredCursorPosition)
if chatFrame == nil and CHAT_FOCUS_OVERRIDE ~= nil then
if CHAT_FOCUS_OVERRIDE.supportsSlashCommands or not text or strsub(text, 0, 1) ~= "/" then
CHAT_FOCUS_OVERRIDE:SetFocus();
if text then
CHAT_FOCUS_OVERRIDE:SetText(text);
end
return;
end
end

local editBox = ChatEdit_ChooseBoxForSend(chatFrame);

ChatEdit_ActivateChat(editBox);
editBox.desiredCursorPosition = desiredCursorPosition;

if text then
editBox.text = text;
editBox.setText = 1;
end

if ( editBox:GetAttribute("chatType") == editBox:GetAttribute("stickyType") ) then
if ( (editBox:GetAttribute("stickyType") == "PARTY") and (not IsInGroup(LE_PARTY_CATEGORY_HOME)) or
(editBox:GetAttribute("stickyType") == "RAID") and (not IsInRaid(LE_PARTY_CATEGORY_HOME)) or
(editBox:GetAttribute("stickyType") == "INSTANCE_CHAT") and (not IsInGroup(LE_PARTY_CATEGORY_INSTANCE))) then
editBox:SetAttribute("chatType", "SAY");
end
end

ChatEdit_UpdateHeader(editBox);
return editBox;
end
But still, cannot find a way.

Hit me up if you have a hint.

Last edited by HolyAA : 07-15-20 at 07:30 PM. Reason: Added code lines.
  Reply With Quote
07-15-20, 08:05 PM   #2
kurapica.igas
A Flamescale Wyrmkin
Join Date: Aug 2011
Posts: 133
Try
Lua Code:
  1. ChatFrame1EditBox:EnableMouse(false)
  Reply With Quote
07-15-20, 08:21 PM   #3
HolyAA
A Defias Bandit
Join Date: Jul 2020
Posts: 2
Originally Posted by kurapica.igas View Post
Try
Lua Code:
  1. ChatFrame1EditBox:EnableMouse(false)
Thanks ! I didnt knew EnableMouse was a thing
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Disabling left click and right click on the chat edit box.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off