Shoutbox

Binding keys to events - 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: Binding keys to events (/showthread.php?tid=75217)

Binding keys to events by splinter98 on 06-09-2007 at 08:41 PM

As part of the script i am currently developing I have an EditControl which when I press enter i can execute a piece of code.

I think I can code everything except how to catch the event in the first place.

The event only needs to be called wise the focus is in the EditControl

After searching through the API and the forums I have found nothing. Can this be done? (I also want the event to be Enter only so no button to do the same thing [keeps the window cleaner]).

Splinter98


RE: Binding keys to events by Dennis Mike on 06-09-2007 at 08:48 PM

use PlusWnd.RegisterMessageNotification(0x100)


RE: Binding keys to events by splinter98 on 06-09-2007 at 08:51 PM

Ahh I knew it was there somewhere

Cheers

Splinter98

Edit: After Finally getting around to play with this, I cant seem to get the OnwindowidEvent_MessageNotification to be called, thus being unable to parse the it to be able to do what i want.

Below is my test Window (completely basic)

code:
    <Window Id="Wndtest" Version="1">
        <DialogTmpl/>
    <Position Width="100" Height="100"/>
    </Window>

And here are my two functions to test it:

code:
function test() {
var PlusWnd = MsgPlus.CreateWnd("OptionsWindow.xml", "Wndtest", 0);
PlusWnd.RegisterMessageNotification(0x100);
}

function OnWndtestEvent_MessageNotification(PlusWnd, nMessage, wParam, lParam) {
Debug.trace("called");
}

i call test and the window displays fine but i can't get the Notification that i have pressed a button (or the Enter key). Again I have searched the forums and MSDN but I just go round in circles and the information isn't stored in one place that is easy to find. (i do knw that the code shld get MessageNotification to be called when a Key is pressed down)

Edit2: Nerver mind have been able to do it using a hidden button