HELP - Hotkeys! - 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: HELP - Hotkeys! (/showthread.php?tid=90980) HELP - Hotkeys! by whiz on 06-08-2009 at 05:05 PM Basically, I need a hotkey that can be used anywhere (is this called "global"?), but I'm not sure how to go about it. I have had a look in a few scripts (including Matty's hotkey example script), but either they're for picking up the key combination within a window, or I have no idea how it works... RE: HELP - Hotkeys! by SmokingCookie on 06-08-2009 at 05:12 PM
The problem with some scripts is, that they cannot be used anywhere (indeed "global"). They only listen for keypresses when a window is in the foreground (which is called "local"; although I still have problems specifying whether the window is actually in the foreground..). RE: HELP - Hotkeys! by Mnjul on 06-08-2009 at 05:18 PM Well you can also look into my HopperLive script's CHopkeyReceiver.js file. Basically you just need to know how RegisterHotKey() API works, how PlusWnd.RegisterMessageNotification() works and how OnWindowIdEvent_MessageNotification() works RE: HELP - Hotkeys! by whiz on 06-08-2009 at 06:19 PM
I've added the following lines to my script: js code:...but the debugger shows "Error: Object expected (code: -2146823281)". Do I need to register the hotkey with the window, like this: js code: EDIT: updated the top code (included Alt/Control/Shift variables) - still doesn't work, though. RE: HELP - Hotkeys! by Matti on 06-08-2009 at 06:35 PM "RegisterHotkey" is a Win32 API function and is located in the "user32.dll" library. You can find this at the bottom of the MSDN page. This means you have to use Interop.Call() to call this function. RE: HELP - Hotkeys! by whiz on 06-08-2009 at 06:46 PM
js code: EDIT: It works with just "MOD_ALT", or with just "MOD_SHIFT", but can I use both? RE: HELP - Hotkeys! by SmokingCookie on 06-08-2009 at 06:57 PM
MOD_ALT | MOD_SHIFT? RE: HELP - Hotkeys! by whiz on 06-08-2009 at 07:02 PM Ok. Just one other thing. "MOD_CONTROL" and "MOD_ALT" work fine, but I can't seem to get "MOD_SHIFT" to work (0x4). Is this the wrong number? RE: HELP - Hotkeys! by SmokingCookie on 06-08-2009 at 07:05 PM
Weird, it is the right number... RE: HELP - Hotkeys! by whiz on 06-08-2009 at 07:10 PM
js code:Like that? RE: HELP - Hotkeys! by SmokingCookie on 06-08-2009 at 07:15 PM
Yep. What also works (and saves some typing) is this: JScript code: RE: HELP - Hotkeys! by whiz on 06-08-2009 at 07:39 PM Although I won't need that, since I only plan to use one notification. RE: HELP - Hotkeys! by SmokingCookie on 06-08-2009 at 07:42 PM Just to let ya know RE: HELP - Hotkeys! by whiz on 06-08-2009 at 08:39 PM Actually, I changed my mind. It's going to have multiple menus (code incorporated)... RE: HELP - Hotkeys! by SmokingCookie on 06-09-2009 at 12:12 PM
Told you RE: HELP - Hotkeys! by whiz on 06-10-2009 at 07:26 PM I've just finished the script, and I'll make a topic for it in a mo (it's called "QuickKey"). |