TeamTalk 5 C-API DLL Version 5.15A
Loading...
Searching...
No Matches
Windows Hotkeys

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.
 

Detailed Description

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.

Function Documentation

◆ TT_HotKey_Register()

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.

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

◆ TT_HotKey_Unregister()

TEAMTALKDLL_API TTBOOL 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

◆ TT_HotKey_IsActive()

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

◆ TT_HotKey_InstallTestHook()

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.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
hWndis the handle of the window which will be notified.
uMsgThe window message to post to hWnd when a key event occurs. Basically it calls PostMessage(hWnd, Msg, VirtualKey-id, Active);
See also
TT_HotKey_RemoveTestHook
CLIENTEVENT_HOTKEY_TEST

◆ TT_HotKey_RemoveTestHook()

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.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
See also
TT_HotKey_InstallTestHook

◆ TT_HotKey_GetKeyString()

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.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nVKCodeThe virtual key code passed in CLIENTEVENT_HOTKEY_TEST.
szKeyNameWill receive key description in local language.
See also
TT_HotKey_Register