TeamTalk 4 C-API DLL  Version 4.5A
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. More...
 
TEAMTALKDLL_API BOOL TT_HotKey_Unregister (IN TTInstance *lpTTInstance, IN INT32 nHotKeyID)
 Unregister a registered hotkey. More...
 
TEAMTALKDLL_API INT32 TT_HotKey_IsActive (IN TTInstance *lpTTInstance, IN INT32 nHotKeyID)
 Check whether hotkey is active. More...
 
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. More...
 
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. More...
 
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. More...
 

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
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nHotKeyIDThe ID of the hotkey to register. It will be passed as the WPARAM when the hotkey becomes either active or inactive.
lpnVKCodesAn 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].
nVKCodeCountThe 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
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nHotKeyIDis 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
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nHotKeyIDis 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
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
hWndis 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
lpTTInstancePointer 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
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nVKCodeThe virtual key code passed in WM_TEAMTALK_HOTKEY_TEST.
szKeyNameWill receive key description in local language.
See Also
TT_HotKey_Register