HotKey

www.progui.co.uk  Top  Previous  Next

HotKey()

Syntax

Success = HotKey(WindowID.i, ID.w, Key$)

Description

Associates or removes a keyboard hot-key combination with a WindowID (HWND). ID is the identifier of the #WM_COMMAND message that will be posted to WindowID's message queue or if WindowID is zero then the hot-key will be an application global hot-key and will be posted to the thread's active root window. ID can also be '-1' to remove/disable the hot-key described in Key$.

Key$ is a text string describing the key combination that triggers the posted ID. Key$ can be written in practically any format, for example "Ctrl+S" would trigger ID to be posted when the Control key and 'S' keys are pressed. The space character and following list of characters are supported as key name delimiters:-

 +  |  -  ,  .  ~  ^  /  \  :  ;  

The Control key, Alt key and Shift key can be combined with any of the alphanumeric keys or following special key descriptions: -

"back"

"tab"

"clear"

"return"

"ret"

"enter"

"ent"

"pause"

"capital"

"caps"

"capslock"

"escape"

"esc"

"space"

"prior"

"next"

"pageup"

"pagedown"

"pgup"

"pgdn"

"end"

"home"

"left"

"up"

"right"

"down"

"select"

"print"

"execute"

"snapshot"

"prtsc"

"insert"

"ins"

"delete"

"del"

"help"

"leftwindows"

"rightwindows"

"leftwin"

"rightwin"

"lwin"

"rwin"

"apps"

"numpad0"

"numpad1"

"numpad2"

"numpad3"

"numpad4"

"numpad5"

"numpad6"

"numpad7"

"numpad8"

"numpad9"

"num0"

"num1"

"num2"

"num3"

"num4"

"num5"

"num6"

 

"num7"

"num8"

"num9"

"pad0"

"pad1"

"pad2"

"pad3"

"pad4"

"pad5"

"pad6"

"pad7"

"pad8"

"pad9"

"multiply"

"add"

"separator"

"subtract"

"decimal"

"divide"

"f1"

"f2"

"f3"

"f4"

"f5"

"f6"

"f7"

"f8"

"f9"

"f10"

"f11"

 

"f12"

"f13"

"f14"

"f15"

"f16"

"f17"

"f18"

"f19"

"f20"

"f21"

"f22"

"f23"

"f24"

"numlock"

"scroll"

"plus"

"minus"

"comma"

"period"

 

If Key$ is an empty string then all the hot-keys for that window (or all global hot-keys if WindowID is equal to zero) will be cleared.

 

Returns true for success, zero for failure.

 

 

General Index