Shoutbox

Entering messages - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: WLM Plus! General (/forumdisplay.php?fid=23)
+----- Thread: Entering messages (/showthread.php?tid=76179)

Entering messages by fayte7523 on 07-18-2007 at 09:43 AM

Hey guys, i was wondering if I could set any other buttons for sending messages instead of the default "enter"? A lot of times I type too fast and i just press enter, so I was wondering if I could set it to maybe TAB+ENTER, like ICQ? If not, could this be a suggestion for future versions? Thx!


RE: Entering messages by ... on 07-18-2007 at 12:39 PM

No. You cannot. The answer is totally NEGATIVE.


RE: Entering messages by fayte7523 on 07-18-2007 at 09:07 PM

i see you can make your own scripts.. I was wondering if this kind of script is possible to write?


RE: Entering messages by markee on 07-19-2007 at 02:38 AM

quote:
Originally posted by fayte7523
i see you can make your own scripts.. I was wondering if this kind of script is possible to write?
It is possible to do this with a script, the other person who replied must not be very familiar with their capabilities.  The only problem with this is that it is a little difficult (I know I haven't done anything like this in the past).  What needs to happen is a hidden Plus! window needs to be used to get the new hotkey (TAB+ENTER for example) and send a message of whatever is in the edit box.  They also need to somehow change a normal ENTER to a hard return in the edit box (this is harder, but I'm sure it is possible.... well maybe).

I don't have the time to work on such a script I'm sorry, though I would like to see the result of someone else doing this....
RE: Entering messages by CookieRevised on 07-19-2007 at 09:41 AM

You don't need any hidden window and/or registering hotkeys or whatever if you use a normal keystroke like ALT+ENTER or CTRL+ENTER. You can catch such key strokes with OnEvent_ChatWndEditKeyDown().

As for trapping the ENTER key, that's another matter. This isn't that easy and would probably require some patching or other advanced technique.

There is also another way of doing it,  but this is a bit dodgy and it wont always work (eg: the use of the command /all, I think). That is catching the send message with OnEvent_ChatWndSendMessage() and if it wasn't send from the OnEvent_ChatWndEditKeyDown() event cancelling the message. If it was send from OnEvent_ChatWndEditKeyDown() let the message through...


RE: Entering messages by markee on 07-19-2007 at 01:25 PM

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? It does however work for CTRL+ENTER.  If this could be done then you would only need to return the boolean value true for when ENTER is pressed instead to stop the use of the ENTER key.

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.

I do realise this creates a way for people to stop messages being sent from a person through the use of a script, but there things a lot worse that a script could be hiding anyway....


RE: Entering messages by foaly on 07-19-2007 at 03:42 PM

Ok there might be a hard way to do with using a messenger script...
But it is quite easy to do it with autohotkey (www.autohotkey.com)
Just make a script with the following code

code:

#ifwinactive ahk_class IMWindowClass
Enter::Send, {Shiftdown} {RETURN} {Shiftup}
#ifwinactive ahk_class IMWindowClass
+Enter::Send, {RETURN}


this would require an extra program to run constantly on your computer so in that way it isn't as nice as a plus script but if I understand Cookie and Markee right, to make such a script is way hard so I'm afraid there is a good chance it will never be made...

[edit]
This exe should do the trick...
As Ezra suggested you could make a script that executes/terminates the exe with Messenger starting up/shuting down...
[/edit]
RE: RE: Entering messages by Ezra on 07-19-2007 at 03:46 PM

quote:
Originally posted by foaly

code:

#ifwinactive ahk_class IMWindowClass
Enter::Send, {Shiftdown} {RETURN} {Shiftup}
#ifwinactive ahk_class IMWindowClass
+Enter::Send, {RETURN}


this would require an extra program to run constantly on your computer so in that way it isn't as nice as a plus script but if I understand Cookie and Markee right, to make such a script is way hard so I'm afraid there is a good chance it will never be made...


Or make a script that starts this autohotkey program? And stops is again when wlm is closed.
RE: RE: Entering messages by CookieRevised on 07-19-2007 at 09:39 PM

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 :p
RE: RE: Entering messages by fayte7523 on 07-21-2007 at 04:14 AM

quote:
Originally posted by foaly
Ok there might be a hard way to do with using a messenger script...
But it is quite easy to do it with autohotkey (www.autohotkey.com)
Just make a script with the following code

code:

#ifwinactive ahk_class IMWindowClass
Enter::Send, {Shiftdown} {RETURN} {Shiftup}
#ifwinactive ahk_class IMWindowClass
+Enter::Send, {RETURN}


this would require an extra program to run constantly on your computer so in that way it isn't as nice as a plus script but if I understand Cookie and Markee right, to make such a script is way hard so I'm afraid there is a good chance it will never be made...

[edit]
This exe should do the trick...
As Ezra suggested you could make a script that executes/terminates the exe with Messenger starting up/shuting down...
[/edit]


Ohh you made a script already? Does it work?
RE: Entering messages by foaly on 07-21-2007 at 10:03 AM

quote:
Originally posted by fayte7523
Ohh you made a script already? Does it work?
well it's not a script.... but it does work :)