SwyxIt! is able to register hotkeys in Windows to trigger actions in SwyxIt! from anywhere in Windows by pressing a keyboard shortcut. There currently is limited support in SwyxWare Powershell to configure these hotkeys. This article gives some hints and example about how to do that.
Prerequisites
The following examples assume that you have a user object in variable $u. To do that, use something like this:
$User = get-ippbxuser -Username Alice
To use the examples in a pipeline use the usual mechanisms, e.g. getting multiple users, pipe them to foreach-object. This will not be explained here.
The examples do not use aliases to shorten commands.
Configuring Keyboard shortcuts for speed dial key
To configure keyboard shortcuts for speed dial keys use the
Get-IpPbxSpeedDialKey
and
Set-IpPbxSpeedDialkey
cmdlets.
To find the scan code to use for a hotkey, see below.
Configuring Keyboard shortcuts for SwyxIt! commands
Getting current hotkey configuration
PS>$UserData = Get-IpPbxUserData -UserEntry $User
PS>$UserData.m_HotkeySettings | format-table
Dirty IsRegistered Command ScanCode Key Alt Shift Ctrl
----- ------------ ------- -------- --- --- ----- ----
True False 32808 0 0 0 0 0
True False 35200 0 0 0 0 0
True False 35100 0 0 0 0 0
True False 35101 0 0 0 0 0
True False 35102 0 0 0 0 0
True False 35103 0 0 0 0 0
True False 35104 0 0 0 0 0
True False 35105 0 0 0 0 0
True False 35106 0 0 0 0 0
True False 35107 0 0 0 0 0
True False 35108 0 0 0 0 0
True False 35109 0 0 0 0 0
True False 35110 0 0 0 0 0
True False 35111 0 0 0 0 0
True False 35112 0 0 0 0 0
True False 36401 0 0 0 0 0
True False 35222 0 0 0 0 0
True False 35223 0 0 0 0 0
True False 35210 0 0 0 0 0
True False 35211 0 0 0 0 0
True False 32825 0 0 0 0 0
True False 35212 0 0 0 0 0
True False 35203 0 0 0 0 0
True False 32827 0 0 0 0 0
True False 32828 0 0 0 0 0
True False 32809 5701633 122 0 0 1
True False 35235 0 0 0 0 0
True False 35238 0 0 0 0 0
True False 35239 0 0 0 0 0
True False 35240 0 0 0 0 0
True False 35241 0 0 0 0 0
True False 35230 0 0 0 0 0
True False 32826 0 0 0 0 0
True False 35229 0 0 0 0 0
True False 35217 0 0 0 0 0
True False 35234 0 0 0 0 0
True False 32829 0 0 0 0 0
True False 35206 0 0 0 0 0
True False 35227 0 0 0 0 0
True False 35228 0 0 0 0 0
True False 32817 0 0 0 0 0
True False 35204 0 0 0 0 0
True False 35218 0 0 0 0 0
True False 35219 0 0 0 0 0
True False 35220 0 0 0 0 0
True False 35215 0 0 0 0 0
True False 35214 0 0 0 0 0
True False 32902 0 0 0 0 0
True False 32789 0 0 0 0 0
True False 32790 0 0 0 0 0
True False 57665 0 0 0 0 0
True False 32932 1966081 65 0 1 1
True False 32962 2293761 72 0 1 1
True False 32963 0 0 0 0 0
True False 32964 2162689 70 0 1 1
True False 32965 1572865 79 0 1 1
Relevant for setting hotkeys are the following properties of the m_HotkeySettings items:
Property | Description |
Command |
The command to execute in SwyxIt when the hotkey is pressed. See list below |
ScanCode | The hardware keyboard specific scan code. There is no easy way in Powershell to determine the scan code. See below for a workaround |
Key | The key to press. This usually the Windows virtual key code. See here for a list. |
Alt | 1 if the alt-key has to be pressed together with the key |
Shift | 1 if the Shift-key has to be pressed together with the key |
Ctrl | 1 if the Ctrl-key has to be pressed together with the key |
List of commands:
Command ID | Description |
32789 |
(Not supported any more) |
32790 |
Logoff |
32808 |
Pop up SwyxIt |
32809 |
Dial selected Number ("F11-Feature") |
32817 |
Recorded Conversations |
32825 |
Minimize SwyxIt! Window |
32826 |
Reject signaled Callback |
32827 |
Request Callback |
32828 |
Pick up signaled Callback |
32829 |
Voicemail Remote Inquiry |
32902 |
Switch User |
32932 |
Away |
32962 |
Handset |
32963 |
Headset |
32964 |
Handsfree |
32965 |
OpenListening |
35100 |
Digit 0 |
35101 |
Digit 1 |
35102 |
Digit 2 |
35103 |
Digit 3 |
35104 |
Digit 4 |
35105 |
Digit 5 |
35106 |
Digit 6 |
35107 |
Digit 7 |
35108 |
Digit 8 |
35109 |
Digit 9 |
35110 |
Asterisk (*) |
35111 |
Hash (#) |
35112 |
Backspace |
35200 |
Hook Off / Hook on |
35203 |
Pick up call to group member |
35204 |
Disable Secondary Call |
35206 |
All Calls (Show Call Journal) |
35210 |
Call Swap |
35211 |
Call Transfer |
35212 |
Add all active Calls to Conference |
35214 |
Do not Disturb |
35215 |
Call Forwarding Unconditional |
35217 |
Conversation Recording |
35218 |
Hide Number / URI |
35219 |
Mute speaker |
35220 |
Mute Microphone |
35222 |
Hold |
35223 |
Phonebook |
35227 |
Redial List |
35228 |
My Callback Request |
35229 |
Transfer To Voicemail |
35230 |
Transfer to Number |
35234 |
Collaboration |
35235 |
Personal Phonebook |
35238 |
Volume Down |
35239 |
Volume Up |
35240 |
Create Journal Entry |
35241 |
Show Contact |
36401 |
Redial |
57665 |
Exit SwyxIt! |
Assign hotkey to a command
To set a hotkey, e.g. Ctrl+Shift+H to hold a call, do the following:
- Lookup the command ID in the table above, e.g. 35222 for "Hold"
- Find the scan code of the keyboard shortcut you want to set (see below)
-
Get the current hotkey configuration array, update the entry for the command and save
$UserData = Get-IpPbxUserData -UserEntry $User
$HotkeyConfig = $UserData.m_HotkeySettings | where Command -eq 35222
$HotkeyConfig.ScanCode = 2293761
$HotkeyConfig.Shift = 1
$HotkeyConfig.Ctrl = 1
Set-IpPbxUserData -UserEntry $User -UserData $UserData
Remove Hotkey from a command
To remove a hotkey, e.g. from "Hold" command, do the following:
- Lookup the command ID in the table above, e.g. 35222 for "Hold"
-
Get the current hotkey configuration array, remove the key config from the entry for the command and save
$UserData = Get-IpPbxUserData -UserEntry $User
$HotkeyConfig = $UserData.m_HotkeySettings | where Command -eq 35222
$HotkeyConfig.ScanCode = 0
$HotkeyConfig.Shift = 0
$HotkeyConfig.Ctrl = 0
$HotkeyConfig.Alt = 0
Set-IpPbxUserData -UserEntry $User -UserData $UserData
How to determine the scan code
There is no easy way to determine the scan code via PowerShell, because it's a keyboard device specific code. As a workaround do the following:
- With SwyxIt configure for the logged in user, e.g. "Alice", one SwyxIt! hotkey with the keyboard configuration you want to use, e.g. use "Logoff"
- Find the command in the list above (Logoff = Command 32790)
- Look up the current config with
(get-ippbxuser -username "Alice" | Get-IpPbxUserData).m_Hotkeysettings | where Command -eq 32790 - Note the scancode property.
Comments
0 comments
Please sign in to leave a comment.