TeamTalk 5 C-API DLL Version 5.15A
|
This section explains how to setup hot-keys on Windows. More...
Functions | |
TEAMTALKDLL_API TTBOOL | TT_HotKey_Register (IN TTInstance *lpTTInstance, IN INT32 nHotKeyID, IN const INT32 *lpnVKCodes, IN INT32 nVKCodeCount) |
Register a global hotkey. | |
TEAMTALKDLL_API TTBOOL | 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 TTBOOL | TT_HotKey_InstallTestHook (IN TTInstance *lpTTInstance, IN HWND hWnd, UINT32 uMsg) |
Install a test hook so the HWND will be messaged whenever a key or mouse button is pressed. | |
TEAMTALKDLL_API TTBOOL | 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 TTBOOL | TT_HotKey_GetKeyString (IN TTInstance *lpTTInstance, IN INT32 nVKCode, OUT TTCHAR szKeyName[TT_STRLEN]) |
Get a string description of the virtual-key code. | |
This section explains how to setup hot-keys on Windows.
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 CLIENTEVENT_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.
TEAMTALKDLL_API TTBOOL 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 CLIENTEVENT_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_EnableVoiceTransmission().
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.
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). |
TEAMTALKDLL_API TTBOOL TT_HotKey_Unregister | ( | IN TTInstance * | lpTTInstance, |
IN INT32 | nHotKeyID | ||
) |
Unregister a registered hotkey.
lpTTInstance | Pointer to client instance created by TT_InitTeamTalk. |
nHotKeyID | is the ID of the hotkey to unregister. |
TEAMTALKDLL_API INT32 TT_HotKey_IsActive | ( | IN TTInstance * | lpTTInstance, |
IN INT32 | nHotKeyID | ||
) |
Check whether hotkey is active.
lpTTInstance | Pointer to client instance created by TT_InitTeamTalk. |
nHotKeyID | is the ID of the registered hotkey. |
TEAMTALKDLL_API TTBOOL TT_HotKey_InstallTestHook | ( | IN TTInstance * | lpTTInstance, |
IN HWND | hWnd, | ||
UINT32 | uMsg | ||
) |
Install a test hook so the HWND will be messaged whenever a key or mouse button is pressed.
Capture the event CLIENTEVENT_HOTKEY_TEST.
lpTTInstance | Pointer to client instance created by TT_InitTeamTalk. |
hWnd | is the handle of the window which will be notified. |
uMsg | The window message to post to hWnd when a key event occurs. Basically it calls PostMessage(hWnd, Msg, VirtualKey-id, Active); |
TEAMTALKDLL_API TTBOOL TT_HotKey_RemoveTestHook | ( | IN TTInstance * | lpTTInstance | ) |
Remove the test hook again so the hWnd in TT_HotKey_InstallTestHook will no longer be notified.
lpTTInstance | Pointer to client instance created by TT_InitTeamTalk. |
TEAMTALKDLL_API TTBOOL TT_HotKey_GetKeyString | ( | IN TTInstance * | lpTTInstance, |
IN INT32 | nVKCode, | ||
OUT TTCHAR | szKeyName[TT_STRLEN] | ||
) |
Get a string description of the virtual-key code.
lpTTInstance | Pointer to client instance created by TT_InitTeamTalk. |
nVKCode | The virtual key code passed in CLIENTEVENT_HOTKEY_TEST. |
szKeyName | Will receive key description in local language. |