removing certain shortcuts  SOLVED

PDF-XChange Editor SDK for Developers

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

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 »

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: 17889
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: removing certain shortcuts

Post by Tracker Supp-Stefan »

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 »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: removing certain shortcuts

Post by Sasha - Tracker Dev Team »

Hello AteBe,

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

Cheers,
Alex
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 »

Now it works.
Thank you
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: removing certain shortcuts

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply