Windows Hotkeys

Hotkeys can be used to e.g. enable push-to-talk. More...

Functions

TEAMTALKDLL_API BOOL TT_HotKey_Register (IN TTInstance *lpTTInstance, IN INT32 nHotKeyID, IN const INT32 *lpnVKCodes, IN INT32 nVKCodeCount)
 Register a global hotkey.
TEAMTALKDLL_API BOOL TT_HotKey_Unregister (IN TTInstance *lpTTInstance, IN INT32 nHotKeyID)
 Unregister a registered hotkey.
TEAMTALKDLL_API INT32 TT_HotKey_IsActive (IN TTInstance *lpTTInstance, IN INT32 nHotKeyID)
 Check whether hotkey is active.
TEAMTALKDLL_API BOOL TT_HotKey_InstallTestHook (IN TTInstance *lpTTInstance, IN HWND hWnd)
 Install a test hook so the HWND will be messaged whenever a key or mouse button is pressed.
TEAMTALKDLL_API BOOL TT_HotKey_RemoveTestHook (IN TTInstance *lpTTInstance)
 Remove the test hook again so the hWnd in TT_HotKey_InstallTestHook will no longer be notified.
TEAMTALKDLL_API BOOL TT_HotKey_GetKeyString (IN TTInstance *lpTTInstance, IN INT32 nVKCode, OUT TTCHAR szKeyName[TT_STRLEN])
 Get a string description of the virtual-key code.

Detailed Description

Hotkeys can be used to e.g. enable push-to-talk.

Windows supports intercepting key strokes globally, i.e. without having the user application's window focused. To investigate which keys are currently being pressed the function TT_HotKey_InstallTestHook can be used. Once the desired key-combination has been found the function TT_HotKey_Register can be used to register the combination as a hotkey and have the WM_TEAMTALK_HOTKEY event posted whenever the key combination becomes active.

Note that it's not advised to have a hotkey installed while debugging an application in Visual Studio. It slows down the debugger dramatically.


Function Documentation

TEAMTALKDLL_API BOOL TT_HotKey_Register ( IN TTInstance lpTTInstance,
IN INT32  nHotKeyID,
IN const INT32 *  lpnVKCodes,
IN INT32  nVKCodeCount 
)

Register a global hotkey.

When the hotkey becomes active or inactive it will send WM_TEAMTALK_HOTKEY to the HWND passed to TT_InitTeamTalk.

A hotkey can e.g. be used as a push-to-talk key combination. When the hotkey becomes active call TT_EnableTransmission.

Note that having a hotkey enabled makes the Visual Studio debugger really slow to respond, so when debugging it's best not to have hotkeys enabled.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nHotKeyID The ID of the hotkey to register. It will be passed as the WPARAM when the hotkey becomes either active or inactive.
lpnVKCodes An array of virtual key codes which constitute the hotkey. This document outlines the virtual key codes: http://msdn.microsoft.com/en-us/library/ms645540(VS.85).aspx A hotkey consisting of Left Control+A would have the array consist of [162, 65].
nVKCodeCount The number of virtual key codes in the array (in other words the size of the lpnVKCodes array).
See also:
TT_InitTeamTalk
TT_HotKey_Unregister
TT_HotKey_InstallTestHook
TEAMTALKDLL_API BOOL TT_HotKey_Unregister ( IN TTInstance lpTTInstance,
IN INT32  nHotKeyID 
)

Unregister a registered hotkey.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nHotKeyID is the ID of the hotkey to unregister.
See also:
TT_HotKey_Register
TEAMTALKDLL_API INT32 TT_HotKey_IsActive ( IN TTInstance lpTTInstance,
IN INT32  nHotKeyID 
)

Check whether hotkey is active.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nHotKeyID is the ID of the registered hotkey.
Returns:
1 if active, 0 if inactive, -1 if hotkey-ID is invalid
TEAMTALKDLL_API BOOL TT_HotKey_InstallTestHook ( IN TTInstance lpTTInstance,
IN HWND  hWnd 
)

Install a test hook so the HWND will be messaged whenever a key or mouse button is pressed.

Capture the event WM_TEAMTALK_HOTKEY_TEST.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
hWnd is the handle of the window which will be notified.
See also:
TT_HotKey_RemoveTestHook
WM_TEAMTALK_HOTKEY_TEST
TEAMTALKDLL_API BOOL TT_HotKey_RemoveTestHook ( IN TTInstance lpTTInstance  ) 

Remove the test hook again so the hWnd in TT_HotKey_InstallTestHook will no longer be notified.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
See also:
TT_HotKey_InstallTestHook
TEAMTALKDLL_API BOOL TT_HotKey_GetKeyString ( IN TTInstance lpTTInstance,
IN INT32  nVKCode,
OUT TTCHAR  szKeyName[TT_STRLEN] 
)

Get a string description of the virtual-key code.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nVKCode The virtual key code passed in WM_TEAMTALK_HOTKEY_TEST.
szKeyName Will receive key description in local language.
See also:
TT_HotKey_Register
Generated on Sun Mar 18 17:18:33 2012 for TeamTalk 4 C-API DLL by  doxygen 1.6.3