Hotkeys

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.
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Hotkeys

Post by docu-track99 »

Hello folks,

I have a few points and questions to make regarding hotkeys.

1. It appears the CTRL+O hotkey for displaying the open dialog doesn't work until you've loaded at least one document already with the open dialog.

2. Is there a simple way of attaching a hotkey to a command item or do I need to implement this on my own (by catching keypress events, etc).

3. I see there is a way to display "hotkey text" on a command item? For example I can see Undo and Redo are marked with CTRL+Z and CTRL+Y. What method(s) should I be looking at to create this kind of text for command menu items.

Thanks!
Doc.It Development
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Hotkeys

Post by Sasha - Tracker Dev Team »

Hello docu-track99,

I will check whether it's possible and will write you a short sample on Monday.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Hotkeys

Post by Sasha - Tracker Dev Team »

Hello docu-track99,

1. This one needs to be investigated more thoroughly.

2,3. The following sample will add the custom shortcut to the Split Pages command. Though there was a small bug and this code will only work from the next (317) build.

Code: Select all

		private void hotkeysTestToolStripMenuItem_Click(object sender, EventArgs e)
		{
			var cmdId = this.pdfCtl.Inst.Str2ID("cmd.document.splitPages", true);
			PDFXEdit.IUIX_Cmd cmd = uiInst.CmdManager.get_Cmd(cmdId);
			PDFXEdit.UIX_CmdAccel accel = new PDFXEdit.UIX_CmdAccel();
			//FVIRTKEY  0x01
			//FSHIFT    0x04
			//FCONTROL  0x08
			//FALT      0x10
			accel.nMod |= 0x01 | 0x04 | 0x08 | 0x10;
			accel.nKey |= (int)Keys.S;
			cmd.AddShortcut(accel);
		}
This is how it will look like:
Image
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: Hotkeys

Post by docu-track99 »

OK thanks, I suppose I'll give this a shot when the next build makes it out.

Thanks,
Doc.It Development
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Hotkeys

Post by Sasha - Tracker Dev Team »

And we will try to figure out the problem with shortcuts and no documents.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ