Edit text while typing - 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: Scripting (/forumdisplay.php?fid=39) +----- Thread: Edit text while typing (/showthread.php?tid=97051) Edit text while typing by #BG on 03-13-2011 at 06:59 PM
I'm pretty much a beginner in scripting. I'd like to make to make a script that changes one or more characters to an other one in the chat window while typing. Should I use OnEvent_ChatWndEditKeyDown to monitor every key I press? Can I use ChatWnd.EditText to delete just what I wrote, and put something else in it's place? This is what I've got so far: code: Thanks for any help! RE: Edit text while typing by matty on 03-13-2011 at 07:14 PM Couldn't you replace the characters in the OnEvent_ChatWndSendMessage function? RE: Edit text while typing by #BG on 03-13-2011 at 07:45 PM
quote:It would be important to leave the opportunity to the user to check the auto correction, and change it back if needed. Is it more complicated this way? RE: Edit text while typing by Matti on 03-13-2011 at 10:38 PM
It's as simple as: js code:When Shift+2 is pressed, the current selection is replaced with whatever you pass to that method. When the user hasn't selected anything but is simply typing, Plus! will treat this as a selection at the current position with zero length. Therefore when you call EditText_ReplaceSel, your replacement will be inserted at the current position. After replacing the selection, simply return true to make Plus! and Messenger stop processing this key. Define ChatWnd by #BG on 03-14-2011 at 01:21 AM It's really simple then. However how should I define the ChatWnd object? (I still get an error and just can't figure out more from the documentations.) RE: Edit text while typing by matty on 03-14-2011 at 02:12 AM
quote:You declared the function pChatWnd so as such any references need to be pChatWnd not ChatWnd as I have highlighted in your code. |