Problems intercepting shortcuts in Power Point with ADXKeyboardShortcut

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

Problems intercepting shortcuts in Power Point with ADXKeyboardShortcut
 
Desenvolvimento Fácil




Posts: 12
Joined: 2015-08-12
Using Word / Excel it is possible to intercept the shortcuts F12 and Shift + F12 which by default mean the "SaveAS" function.

I need to prevent the user from using the "SaveAS" functionality, however in PowerPoint, using the ADXKeyboardShortcut class is not working.

it just does not fire.
Posted 13 Dec, 2018 08:49:19 Top
Andrei Smolin


Add-in Express team


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

This isn't an Add-in Express restriction or bug. The possible variants are: 1) the host application itself defines what keyboard presses won't be delivered to you and 2) some settings in your code prevents getting that event.

In a test add-in project, the following ADXKeyboardShortcut receives {F12} pressed in PP Version 1901 Build 11128.20000 Click-to-Run (this is an Office Insider build).


            // 
            // adxKeyboardShortcut1
            // 
            this.adxKeyboardShortcut1.ShortcutText = "F12";
            this.adxKeyboardShortcut1.Action += new AddinExpress.MSO.ADXAction_EventHandler(this.adxKeyboardShortcut1_Action);


HTH

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Dec, 2018 09:04:48 Top
Desenvolvimento Fácil




Posts: 12
Joined: 2015-08-12
I did a new solution, only for Power Point and this shortcut test, check the code.
http://apoio.facil.com.br/files/docsite/ppf12.zip

I've tried in Office 2010, 2013, 2016 in the following builds:
- Office Standard 2010 - 14.0.7181.5000 64 bits
- Office Home and Business 2013 - 15.0.4433.1507 64 bits
- Office Professional Plus 2016 - 16.0.9126.2315 64 bits

Its just register -> Debug -> Open PowerPoint and press F12.
Posted 13 Dec, 2018 11:17:39 Top
Andrei Smolin


Add-in Express team


Posts: 16214
Joined: 2006-05-11
Thank you.

You also need to set ADXAddinmodule.HandleShortcuts = true.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 14 Dec, 2018 01:12:07 Top
Desenvolvimento Fácil




Posts: 12
Joined: 2015-08-12
Thank you Andrei.

Yes, its works fine, Thank you!!
Posted 17 Dec, 2018 07:56:07 Top
Andrei Smolin


Add-in Express team


Posts: 16214
Joined: 2006-05-11
Welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 17 Dec, 2018 07:56:31 Top