PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

Moderators: Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Tracker Supp-Stefan

 
fiscal
User
Topic Author
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Can I add a hotkey

Mon Jun 27, 2011 2:15 am

Is it possible to add a custom hotkey that I can invoke when the ActiveX control has focus.

The wish is to invoke some clarion code when a document is active in the ax control.

I am revisiting a way to copy pages from one document to another, behind the scenes.

When I select some pages in the thumbnail list, I wish to be able to press a function button, say F2, and it will extract the pages from the active document and append them into another file, and add some notes about the additional pages in another data file. The code to do this is OK, but I just cannot seem to invoke the altered key when the control has focus.

Thanks

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

Re: Can I add a hotkey

Mon Jun 27, 2011 8:50 am

Hello Tony,

If it is your main application window that has the focus, and is listening for key strokes - you can set up any hotkeys - and make them execute any commands available through the AX SDK. However it is not possible to add custom hotkeys inside the AX control for combined or multi step commands.

Best,
Stefan
 
fiscal
User
Topic Author
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Re: Can I add a hotkey

Mon Jun 27, 2011 9:45 am

Hi Stefan,

If I add a hot key to the window, say F2. I cannot execute that hotkey, unless I click on an area of the window other than the AX control.

I do have code under a button to perform what I need, but it would be easier on the user if they can also use a hot key.

So, from what I think you are saying, if the AX control has a document open and has focus, then the hotkey will not work?

See ya

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

Re: Can I add a hotkey

Mon Jun 27, 2011 10:29 am

Hi Tony,

Actually looking through the AX Manaul, you could intercept a key stroke - and execute any set of commands you like:

function OnEvent(Type, Name, DataIn, DataOut, Flags)
{
   if (Type == PXCVA_OnNamedNotify) and
      (Name == "Notifications.Keyboard") thenPDF-XChange Viewer SDK 174
   {
      // Get keyboard event message
      GetProperty("Notifications.Keyboard.Code", vDataOut, 0);
      if (vDataOut == 71) then //F2 Key pressed
      {
         //Perform any commands you would like
      }
   }
}


P.S. Also if you wish to skip the default processing of the key by the Viewer (if there is any - as F2 by default does not have an action assigned) - also make sure to include
SetProperty("Notifications.Keyboard.Skip", "true", 0);
before the return of your event handler.

Best,
Stefan
 
fiscal
User
Topic Author
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Re: Can I add a hotkey

Mon Jun 27, 2011 10:46 am

Thanks Stefan,

Where would I place such code to trap the keystroke? I could not locate the onevent stuff in my documentation.

Thanks

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

Re: Can I add a hotkey

Mon Jun 27, 2011 10:48 am

Hello Tony,

I am not sure how this will look in Clarion, so I will need to speak with Craig, but if you do not have the latest build of our Viewer SDK - make sure to download it - the documentation and samples should have an event handling sample - the non clarion code samples certainly do.

Best,
Stefan
 
fiscal
User
Topic Author
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Re: Can I add a hotkey

Mon Jun 27, 2011 1:55 pm

Hi Stefan,

I have the latest download, and I cannot find it, but if it is in version 3 then I will be happy....

Tony
 
Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Can I add a hotkey

Mon Jun 27, 2011 4:56 pm

Hi Tony!

I think I know what Stefan is referring to. It may not be in the Viewer SDK 2.x docs.

I may be able to modify the Viewer's Clarion Class files to trap the keystrokes. I'll need some time to check this out.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com
 
fiscal
User
Topic Author
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Re: Can I add a hotkey

Mon Jun 27, 2011 11:45 pm

Thanks Craig,

I have to wait for version 3 for the code command to fire up the NewDocumentFromScanner method, so it can wait until then.

See ya

Tony
 
Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Can I add a hotkey

Sat Oct 27, 2012 10:40 am

Hi Craig,

This topic is interesting me. Is it already possible to trap keystrokes in the class files? That would be great. Especially if it would be possible to replace the default shortcuts. Some of the shortcuts used in the AX control are also used in my application but with a different function.

That might be confusing for the user :)

Cheers,
Koen
 
Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Can I add a hotkey

Sat Oct 27, 2012 3:21 pm

Hi Koen!

I tested this but found that it does not perform as advertised. It is SUPPOSED to be working in version 3, but I have no estimated release date for that version.
Craig Ransom

Tracker Software - Clarion Support

http://www.tracker-software.com
 
Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Can I add a hotkey

Sun Oct 28, 2012 10:58 am

Hi Craig,

Well you gain some, you lose some. I guess we have to wait a bit longer for this possibility.

Thanks,
Koen
 
Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Can I add a hotkey

Sun Oct 28, 2012 12:29 pm

:)
Craig Ransom

Tracker Software - Clarion Support

http://www.tracker-software.com

Who is online

Users browsing this forum: No registered users and 1 guest