How can I allow Copy, Cut, Paste keyboard shortcuts?

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Hello,

I need to allow Ctrl+C, Ctrl+X and Ctrl+V only - NO other Shortcuts (like Ctrl+S...)!

But "AllowAllAccelerators" allows ALL Shortcuts and if I disable "AllowAllAccelerators" then I see no way to catch this Shortcuts because there are no KeyPress or KeyDown/Up Events exist!

So please HOW can I allow Copy, Cut, Paste keyboard shortcuts? :?:

Thank you very much
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Corwin - Tracker Sup »

Hi,
You can clear unnecessary shortcuts using the "Customize" dialog (right click on menu -> Customize->Commands).

After that you should export these revised settings, and import them on starting your program.

HTH.
User avatar
Lzcat - Tracker Supp
Site Admin
Posts: 677
Joined: Thu Jun 28, 2007 8:42 am

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Lzcat - Tracker Supp »

Maybe disabling/enabling commands instead of their shortcuts will be more useful?
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Corwin - Tracker Sup wrote:Hi,
You can clear unnecessary shortcuts using the "Customize" dialog (right click on menu -> Customize->Commands).

After that you should export these revised settings, and import them on starting your program.
OK, but HOW can I do that "BY CODE"? Because my customers will not have YOUR User-Interface.

How to Im-/Export a shortcut-List ??? And what is, if you spend a new shortcut in future release? How can I detect this?

--------------
Lzcat - Tracker Supp wrote:Maybe disabling/enabling commands instead of their shortcuts will be more useful?
OK, also a way. But can I make a Loop by code through all Shortcuts? Because I will be sure for future Releases of your AX, that I ONLY activate my allowed shortcuts.

...something like this (pseudo code):

For i = 1 to Commands.Count
If Commands(i).HasShortcut And Commands(i).Name <> "Cut" Then
Commands(i).Enabled = False
End If
Next
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Corwin - Tracker Sup »

OK, but HOW can I do that "BY CODE"? Because my customers will not have YOUR User-Interface.
When you export settings you will also export all keyboard shortcuts that you have manually configured.
How to export or import settings you can see in PDF-XChange Viewer SDK sample projects.

Code: Select all

Call CoPDFXCview1.SaveSettings("c:\settings.dat")
Call CoPDFXCview1.LoadSettings("c:\settings.dat")
For now that is the only way to configure Viewer shortcuts.
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Corwin - Tracker Sup wrote: When you export settings you will also export all keyboard shortcuts that you have manually configured.
OK, I do understand now. Is there a better customizing for developers planned in the near future?

THank you
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Corwin - Tracker Sup »

Good news - this feature will be available in new build.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Rad1 »

Corwin - Tracker Sup wrote:Good news - this feature will be available in new build.

What about functions like :

object GetAnnotationdetails() // Signature // Comment // Stamp // ...etc.

I know I can do this using RunJS, but I use JavaScript to develope my application (I can't get result of runing script !!). Are you planing to add this feature in next build ??
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Corwin - Tracker Sup wrote:Good news - this feature will be available in new build.
Hello Corwin,

which new build do you mean?

The new v2.0.0042.4? In your "Version History" is nothing about the new version, so I can't see, if this feature is implemented now.

And please how can I handle this feature? I found nothing in your PDF-Help.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Vasyl - PDF-XChange »

You can use this feature, it is already in 42.4.

To disable the command shortcut, call:

Code: Select all

SetProperty("Commands[#CmdID].Shortcut.Key", 0);
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Thank you, but it does not work with v2.0.42.4.

My Code is...

Code: Select all

vDataIn = 0
CoPDFXCview1.SetProperty "Commands[#57637].Shortcut.Key", vDataIn
...but Paste is still possible by Ctrl+V.

----------------

BTW: However, I think that it would be better, if the operation would reverse. I Mean that I do not deactivate but activate for a better controlling of my application. So first I disable "Allow All Accelerators" and then only allow shortcuts, they I realy needed.

At your variant I MUST KNOW ALL OF YOUR possible shortcuts to prevent these. Then I must disable ALL. Many work and if you add some new shortcuts in future builds (they I dont know), I have a big problem... :?
(Hope you understand my english).
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Corwin - Tracker Sup »

Hi Dorwol,

To clear shortcut you should set to zero "Shortcut.Key" and "Shortcut.Modifiers" properties of specified command. For example:

Code: Select all

CoPDFXCview1.SetProperty "Commands[#57637].Shortcut.Modifiers", 0
CoPDFXCview1.SetProperty "Commands[#57637].Shortcut.Key", 0
You can also clear shortcuts for all commands by using next code:

Code: Select all

 Dim str As String
 Dim vDataOut As Variant
 vDataOut = 0
 Dim bsName As String
 bsName = "Commands.Count"
 Dim nCount As Integer
 nCount = 0
 Call CoPDFXCview1.GetProperty(bsName, vDataOut, 0)
 nCount = Int(vDataOut)

 For i = 0 To nCount - 1
     str = "Commands[" & i & "].Shortcut."
     Call CoPDFXCview1.SetProperty(str + "Modifiers", 0, 0)
     Call CoPDFXCview1.SetProperty(str + "Key", 0, 0)
 Next
HTH
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Corwin - Tracker Sup wrote: You can also clear shortcuts for all commands by using next code:
...
FANTASTIC! BIG THX!
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Corwin - Tracker Sup wrote:

Code: Select all

CoPDFXCview1.SetProperty "Commands[#57637].Shortcut.Modifiers", 0
CoPDFXCview1.SetProperty "Commands[#57637].Shortcut.Key", 0
Please believe me, "Copy", "Paste", "Cut", "Undo", "Redo" ...and some more are still possible. :(
Try it and you'll see, that "Ctrl+C", "Ctrl+V" and "Ctrl+X" and some more are still activated!!!
All the other shortcuts seems to be deactivated!?!

---

And another big problem is, that the shortcuts fires very very rapid.

In the same second I press "Ctrl+Z", aLL my changes are completely Undo - like "Undo All"! :?
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Corwin - Tracker Sup »

Ok, we will try to fix this in new build.
Thanks.
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Thank you.

For your Information: The bug with rapidly Undo/Redo-shortcuts is NOT in v2.0.42.3. It is only in the currently v2.0.42.4 :!:

Hope this info will help you! :)
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by John - Tracker Supp »

Thanks Dorwol, investigating ...
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Vasyl - PDF-XChange »

Hi, Dorwol
And another big problem is, that the shortcuts fires very very rapid.
...
For your Information: The bug with rapidly Undo/Redo-shortcuts is NOT in v2.0.42.3. It is only in the currently v2.0.42.4 :!:
This issue will be fixed in the next build. Please wait..

Thanks.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Vasyl - PDF-XChange »

And new feature will be added into next build.
In next build you will be able to disable/enable shortcut for specified command by code:

Code: Select all

SetProperty("Commands["Copy"].Shortcut.Use", "true"|"false", 0);
by default this property means 1("true") for all commands.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: How can I allow Copy, Cut, Paste keyboard shortcuts?

Post by Dorwol »

Wow! :mrgreen: