ADXKeyboardShortcut

Add-in Express™ Support Service
That's what is more important than anything else

ADXKeyboardShortcut
 
xblb




Posts: 36
Joined: 2017-11-27
Hello.

I use ADXKeyboardShortcut. Works well when I set ShortcutText Ctrl+Z, but not working with Ctrl+ZX.

What should be done to make this combination work?

Thanks
Posted 28 Nov, 2017 06:55:28 Top
Andrei Smolin


Add-in Express team


Posts: 14906
Joined: 2006-05-11
Hello,

Use the ADXAddinModule.OnKeyDown event instead. Note that you must *not* issue any calls to any Office object model in that event. You can only perform such calls after a delay; see section Wait a Little at https://www.add-in-express.com/docs/net-office-tips.php#wait-a-little. You can find a recent example of using the ADXAddinModule.OnKeyDown event at https://www.add-in-express.com/forum/read.php?FID=5&TID=14780.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Nov, 2017 07:22:35 Top
xblb




Posts: 36
Joined: 2017-11-27
Ok,
how then to describe my condition Ctrl+Z+X
private void ThisAddIn_OnKeyDown(object sender, ADXKeyDownEventArgs e)
{
if (e.Ctrl && e.VirtualKey == (int)Keys.Z && ???????)
{
}}
Posted 28 Nov, 2017 08:55:29 Top
Andrei Smolin


Add-in Express team


Posts: 14906
Joined: 2006-05-11
Set a flag when Ctrl+Z is pressed. Clear the flag if any key (key combination) is pressed next. An exception is Ctrl+X: in this key you get Ctrl+Z+X pressed: handle the shortcut first and clear the flag then.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Nov, 2017 09:27:44 Top
Andrei Smolin


Add-in Express team


Posts: 14906
Joined: 2006-05-11
in this key --> in this case.

Sorry.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Nov, 2017 09:33:08 Top
xblb




Posts: 36
Joined: 2017-11-27
Thank you
Posted 28 Nov, 2017 11:12:25 Top
Andrei Smolin


Add-in Express team


Posts: 14906
Joined: 2006-05-11
You are welcome.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Nov, 2017 02:40:13 Top