quote:
Originally posted by markee
Firstly, I'm sorry Cookie for not remembering that event in the first instance. I just remembered another time when someone wanted a hot key and had to use that method. But I do have a question to propose....
Is there a reason why Plus! does not trigger OnEvent_ChatWndEditKeyDown() when either ENTER or SHIFT+ENTER is pressed?
I think it is done on purpose, though I can be wrong completely (but I actually can't imagine he wouldn't be able to catch the ENTER key). So, dunno really, you should ask this to Patchou...
What I do know (and what you can read in the docs also) is that he uses a hook on the WM_KEYDOWN Window message to detect keystrokes. And most likely also WM_CHAR...
VK_RETURN (virtual keycode constant for the ENTER key) is nicely detected with those Windows message. This means, when you hook the chatwindow yourself, you could detect the WM_KEYDOWN or WM_CHAR message and look for VK_RETURN... Which is probably the best method to do all this as it is 100% reliable. But this also requires an external dll for hooking the chat window.
(or... or... or... I think it can be done with only pure scripting, though I need to experiment with this first to confirm it or not though).
This said, the reason why CTRL+ENTER triggers the event is because CTRL+ENTER actually equals an ascii character: 0x10, whereas SHIFT+ENTER is just the same ascii character as only ENTER: 0x0D, which is 'ignored'.
quote:
Originally posted by markee
It is not like it would even effect the use of selecting a command from Plus!'s command box either because those keypresses aren't detected (which is understandable and how it should react). And furthermore it would not effect the use of the likes of the /all command either because it is only nullifying the use of the ENTER key.
The thing I said in regards to this is if you use the second method I described: the 'dodgy' method to catch a ENTER key by using
OnEvent_ChatWndEditKeyDown() together with
OnEvent_ChatWndSendMessage. In that case, it would effect commands and especially a command like /all because the actual message being send is different than the one you pressed ENTER on; you actually didn't entered the message send to other conversations. Hard to explain, but I cba to make an example script to show what I mean