Shoutbox

ChatWndEditKeyDown... HELP... - 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: ChatWndEditKeyDown... HELP... (/showthread.php?tid=64284)

ChatWndEditKeyDown... HELP... by uggi on 07-31-2006 at 03:15 PM

I'm new to MSN !Plus !Live scripting and i want to make my own plug-in, i have read det "fine/fucking" manual and i have made some functions now, but not all of dem are working...

I also have some other functions like the "Personal Message Chat" plug-in, but when people writes "!popup <and a message>" it just shows it in a popup...

BUT now i want's to make some short cuts with the ChatWndEditKeyDown Event...

If i read in the "manual":

quote:
The OnEvent_ChatWndEditKeyDown event is fired every time a key is pressed in the typing area of a chat window. It can be used to filter out some keys and use them as shortcuts for a feature of the script.


I get that... and i know that you need to have a [object] ChatWnd and a [number] KeyCode... i also know that the KeyCode for ABC is.. (41, 42  and 43) but i cant get the scripts working...

quote:
//
//    This code run then you type something in the typing area..
//
function OnEvent_ChatWndEditKeyDown(ChatWnd,KeyCode)
{
    var Key = KeyCode;
        //
        //     If you press 0 in the typing area...
        //
    if(Key == 30) {
        ChatWnd.SendMessage("/ctcinfo");
    }
}


this script open the profile for a contact if you press the key "0"... hmm not...

I know that this code DON`T WORK... but i donīt know why...

So, can anyone please help me to understand the function... ( i'm sorry for the bad english.. )
RE: ChatWndEditKeyDown... HELP... by RaceProUK on 07-31-2006 at 04:01 PM

The keycodes you quoted are hexadecimal. In decimal, they're 65, 66, 67 etc. Also, they're for capital letters. Lowercase letters have codes starting from 97.

Edit: Also, '0' = 48, '1' = 49 etc.

Edit 2: http://www.lookuptables.com/


RE: ChatWndEditKeyDown... HELP... by uggi on 07-31-2006 at 04:06 PM

If you read this..

Link

You can see that the A is (41) and so on.. i donīt know anything about that the 41 i hex or not...


RE: ChatWndEditKeyDown... HELP... by deAd on 07-31-2006 at 04:21 PM

http://www.ryancooper.com/resources/keycode.asp
Always worked for me. :P


RE: ChatWndEditKeyDown... HELP... by matty on 07-31-2006 at 04:25 PM

code:
//
// This code run then you type something in the typing area..
//
function OnEvent_ChatWndEditKeyDown(ChatWnd,KeyCode) {
    var VK_O = 0x4F;
    Debug.Trace('KeyCode : '+KeyCode);
    if(KeyCode == VK_O) {
        ChatWnd.SendMessage('/ctcinfo');
    }
}

RE: ChatWndEditKeyDown... HELP... by uggi on 07-31-2006 at 04:35 PM

Thanks to all of you.. :D


RE: ChatWndEditKeyDown... HELP... by uggi on 07-31-2006 at 05:12 PM

quote:
Originally posted by Matty
code:
//
// This code run then you type something in the typing area..
//
function OnEvent_ChatWndEditKeyDown(ChatWnd,KeyCode) {
    var VK_O = 0x4F;
    Debug.Trace('KeyCode : '+KeyCode);
    if(KeyCode == VK_O) {
        ChatWnd.SendMessage('/ctcinfo');
    }
}


I need to know.. how can i use words like "!profile" or "!info" in this script ?
Do i need to make a var for every 0x!! ?? or how can i make it ??
RE: ChatWndEditKeyDown... HELP... by matty on 07-31-2006 at 06:07 PM

quote:
Originally posted by uggi
quote:
Originally posted by Matty
code:
//
// This code run then you type something in the typing area..
//
function OnEvent_ChatWndEditKeyDown(ChatWnd,KeyCode) {
    var VK_O = 0x4F;
    Debug.Trace('KeyCode : '+KeyCode);
    if(KeyCode == VK_O) {
        ChatWnd.SendMessage('/ctcinfo');
    }
}


I need to know.. how can i use words like "!profile" or "!info" in this script ?
Do i need to make a var for every 0x!! ?? or how can i make it ??
Use this either of these functions:

[string] OnEvent_ChatWndReceiveMessage(
    [object] ChatWnd,
    [string] Origin,
    [string] Message,
    [enum] MessageKind
);
[string] OnEvent_ChatWndSendMessage(
    [object] ChatWnd,
    [string] Message
);
RE: ChatWndEditKeyDown... HELP... by uggi on 07-31-2006 at 06:31 PM

thanks