Shoutbox

Need some help with HotKey - 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: Need some help with HotKey (/showthread.php?tid=80989)

Need some help with HotKey by Yorick on 01-16-2008 at 07:23 PM

Hey guys,

I'm working on a translation plugin, screen below:

[Image: UltimateTranslatorOptions.png]

As you see it will be possible to set a HotKey to translate a message you have typed. But I am have a problem with retrieving the HotKey that is entered into the HotKeyControl. What function is used for retrieving the entered HotKey?

CheckboxControl - Button_IsChecked()
ListBoxControl - LstBox_GetCurSel()
HotKeyControl - ???()

Thanks in advance!


RE: Need some help with HotKey by warmth on 01-16-2008 at 07:39 PM

:O nice script mate... hope one of my great scripter friends can help you with... sounds very promising...


RE: Need some help with HotKey by Yorick on 01-16-2008 at 07:50 PM

quote:
Originally posted by MeEtc
OnEvent_ChatWndEditKeyDown is an event that will return the value of a pressed key combination when the chat window is active

code:
function OnEvent_ChatWndEditKeyDown(ChatWnd, KeyCode, CtrlKeyDown, ShiftKeyDown
);


Ok that's what I'll need later, but the problem at the moment is different. When you click on Save you're setting will be saved in the registry, but before I can save this into the registry I need to retrieve the information entered into the HotKey control. That my problem for now, I can't find anything about retrieving the HotKey that is entered...

RE: Need some help with HotKey by MeEtc on 01-16-2008 at 07:51 PM

take a look at the hotkeys.js file within the Now Playing script by dt. He has a similar feature to record a key combination. Attaching the file for convenience.
EDIT: yes, I realized what you mean now after I posted, thats why I deleted my previous post


RE: Need some help with HotKey by matty on 01-16-2008 at 08:19 PM

To actually get the value of the HotkeyControl you need to use the HK_GETKEY message.

Here is the code:

code:
Debug.Trace(Interop.Call('user32','SendMessageW', pPlusWnd.GetControlHandle('NameOfTheHotkeyControl'), (0x0400 /* WM_USER */ +2) /* HK_GETKEY */, 0, 0));

RE: Need some help with HotKey by Yorick on 01-16-2008 at 09:28 PM

Yes I was looking into the Music Now Playing code already, and it's exactly where I'm lookoing for. But I thnk I won't implent it in the first version, I'll use a pre-set shorcut for it (like the google translator script uses F5) instead of choosing your own shortcut.

Maybe I'll add it later, I'll first finish this script as it is now. Do you guys like the options page as it is now?


RE: Need some help with HotKey by MeEtc on 01-16-2008 at 10:33 PM

I think it looks great. keep going!