Moderator: MacroQuest Developers



Code: Select all
<code to click in main chat box>
/keypress chat x
Code: Select all
/keypress enterCode: Select all
<code to click in main chat box>
/keypress xxxxx chat
/delay 10s
<code to make the chat send>
I realize that, and sort of expected it, which is why I didn't type those commands in the window, I would make a way to be able to have them execute while the cursor was in the chat window. Ie. an alias that fires on a ctrl+key, which wouldn't remove focus from the chat window.Lax wrote: That being said....
if you TYPE THE FUCKING COMMAND ITS NOT GOING TO DO ANYTHING FOR YOU. e.g. typing "/keypress x chat", or typing an alias that does "/keypress x chat" is not going to press x in the chat window, its just going to press x.
Oddly, your top info doesnt show you having a text entry selected, but your bottom info does. I wonder which one will work.. hmm.. hmmmmmmm... must be a bug obviously!
In general, I like to try to figure things out myself before asking. As a result, I have tried just about every function call that seemed remotely related in C++, and then started resorting to DoCommands, hoping against hope that they would work where the C++ methods did not.Lax wrote:like I said, there was examples for macros so I dont know why people are still having issues with this macro-wise. For plugins if you were having this trouble for so long why didnt you ask before how to do it?
Lastly why are you calling the command function instead of the functions the command calls? I really have no idea why people always do that.
I assume you mean, litterally typing "blah, blah, blah" in the chat box, NOT "/keypress X chat".... since the latter would obviously not work, since when you hit enter, the chat box would no longer have focus....Lax wrote:Why does it work perfectly when you're typing it yourself, if MQ2 handles every key you press?
That's good to know, was just putting it in because I remember reading in a couple places that VS6 has had issues with some areas of MQ2, and often you were saying to make sure you had the latest patch. Was just putting it in as part of the process of elimination.Lax wrote: and no it has nothing to do with VS6
Okay, that does explain why it wasnt working. If your custom bind fired on CTRL+V and it did this: "/keypress x chat", the problem is that you were holding down CTRL. This means the EFFECTIVE command was "/keypress ctrl+x chat", even though that isnt what you desired. I'll add /noctrl /noalt /noshift commands to do the opposite of what the /ctrl /alt /shift commands do (e.g. those commands act as though the key is held down for that time, even if it is already held down.. the new commands will act as though the key is NOT held down for that time)I realize that, and sort of expected it, which is why I didn't type those commands in the window, I would make a way to be able to have them execute while the cursor was in the chat window. Ie. an alias that fires on a ctrl+key, which wouldn't remove focus from the chat window.
Code: Select all
bool KeyboardFlags[4];
*(DWORD*)&KeyboardFlags=*(DWORD*)&((PCXWNDMGR)pWndMgr)->KeyboardFlags;
*(DWORD*)&((PCXWNDMGR)pWndMgr)->KeyboardFlags=0;
pWndMgr->HandleKeyboardMsg('L',1);
pWndMgr->HandleKeyboardMsg('L',0);
pWndMgr->HandleKeyboardMsg('a',1);
pWndMgr->HandleKeyboardMsg('a',0);
pWndMgr->HandleKeyboardMsg('x',1);
pWndMgr->HandleKeyboardMsg('x',0);
*(DWORD*)&((PCXWNDMGR)pWndMgr)->KeyboardFlags=*(DWORD*)&KeyboardFlags;