removing certain shortcuts  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

removing certain shortcuts

Post by AteBe » Mon Oct 14, 2019 12:52 pm

Hello,
I want to remove certain shortcuts (for example, CTRL + N) when starting the application.
Unfortunately I did not find an example.
How can I remove this shortcut? Can you please send me a code example.
Thanks
AteBe

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14096
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: removing certain shortcuts

Post by Tracker Supp-Stefan » Mon Oct 14, 2019 2:08 pm

Hello AteBe,

It would be better to disable a command completely - that way the user will not be able to access it neither with a key combination nor through the UI (and you still have access to perform the operation if needed via code).

Regards,
Stefan

AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

Re: removing certain shortcuts

Post by AteBe » Tue Oct 15, 2019 5:42 am

Hello Stefan,

I have already successfully removed the menu item cmd.newDocBlank with the following code.

Code: Select all

	Object o = getInst().GetExtension("UIX");
	Pointer ptr = ((Unknown) o).getPointer();
	IUIX_Inst in = new IUIX_Inst(ptr);
	IUIX_Cmd menu = in.CmdManager().Cmds().Find(menuId);
	if (menu != null)
	    menu.Hidden(hideMenu);
Nevertheless, when I use the shortcut CTRL + N, the following pop-up appears.
NewEmptyDocument.PNG
How can I prevent this?

AteBe

User avatar
Sasha - Tracker Dev Team
User
Posts: 5037
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: removing certain shortcuts

Post by Sasha - Tracker Dev Team » Tue Oct 15, 2019 8:49 am

Hello AteBe,

You should put the command as Offline - then the user won't be able to use it.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

AteBe
User
Posts: 63
Joined: Thu Dec 06, 2018 7:02 am

Re: removing certain shortcuts  SOLVED

Post by AteBe » Tue Oct 15, 2019 9:03 am

Now it works.
Thank you

User avatar
Sasha - Tracker Dev Team
User
Posts: 5037
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: removing certain shortcuts

Post by Sasha - Tracker Dev Team » Tue Oct 15, 2019 9:06 am

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply