There is a hot key class. Check out the "Video Converter Plus!" link in my signature; it points to a script that uses the particular class ("Hotkey.js"). Using that class, you can specify what should be done to the window:
JScript code:
// The [ENTER] key
VK_RETURN = 0x0D;
// Create the window
var WndTest = MsgPlus.CreateWnd("Windows.xml" /* can be any XML file */,"WndTest" /* The window ID you want to create */)
// Create the hot key
// Note the last parameter
new Hotkey(VK_RETURN,0,MyWindow.Handle,function() {
<do_what_you_want_here>
} /* This is how you specify an anonymous function.
Allows you to specify a function without using a variable */ );
//Register it
Hotkey_RegisterNotification(WndTest);
// Listen to the hot key notification
function OnWndTestEvent_MessageNotification(PlusWnd,Message,lParam,wParam) {
// Call Hotkey_HandleEvent(); with the same parameters as the MessageNotification function.
Hotkey_HandleEvent.apply(this,arguments);
}
// Make sure the hot key gets destroyed
function OnWndTestEvent_Destroyed(PlusWnd,ExitCode) {
Hotkey_WindowDestroyed(PlusWnd);
}
This should work.
Side-note: credits go to Matti