Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Disabling certain shortcut keys
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Disabling certain shortcut keys

 Post Reply Post Reply
Author
Message
Marek View Drop Down
Groupie
Groupie


Joined: 02 February 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marek Quote  Post ReplyReply Direct Link To This Post Topic: Disabling certain shortcut keys
    Posted: 03 February 2005 at 1:42pm

Hi,

Is there a way to disable a set of characters to be used as shortcut keys? ie if a user selects one of the forbidden shortcut keys in the Customization Dialog, a warning would appear and the key would be disallowed?

Thanks.

-m

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 03 February 2005 at 1:44pm
I suppose you could add a key binding for all disallowed key to an ID, and in the commandbars_execute event you can use this Id to display you message.
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 03 February 2005 at 3:14pm

I've actually spent at lot of time looking into this, and there is no solution.

A simple scenario is using Ctrl+C for the Copy command.  This is a shortcut that is used by many controls in an application, and it'd be crazy to assign this to a CommandBarControl because it's almost impossible to figure out which of the many controls on the screen should have the copy command applied to it.  The real problem is with customization.  If a user goes and customizes the Ctrl+C shortcut, you've just lost the built-in copy functionality from all your controls (since CommandBars will steal the command from everything in your app).

The easy workaround would be for Codejock to update the customization procedures to either allow you to specificy shortcuts that cannot be used to customize OR at least expose an event you can respond to before a key binding is added that would allow you to cancel the assignment.

Way back on Sept 16, 2004, I submitted an item to Codejock title "More Properties/Methods for CommandBars KeyBindings" (Issue #1713).  The following summarizes that request:

Request: The Xtreme Suite for ActiveX CommandBars object only allows you to programatically add keybindings. I would like to see more properties and method available to the programmer for use with keybindings:

1) Method to Delete KeyBinding from a Command
2) Property to determine which Command is bound to a key
3) Ability to enumerate all configured KeyBindings

Since I allow users to customize toolbars, I have no way of knowing what KeyBindings they have created. Because I reserve certain shortcut keys (like F1), I also need to be able to prevent the user from binding certain keys to a command. Can you add a ''BeforeAddKeyBidning'' event to CommandBars that allows the programmer to cancel a particular keybinding request. This would allow me to detect that the user tried to bind F1 to a command so I could refuse the new key binding and prompt them for the reason why.

I''ve requested this feature in the past, but I''ve never really heard anything about it. I''d appreciate it if someone could comment on the possibility of incorporating this into the CommandBars product.

Keep up the great work!!

Unfortunately, it's now been 5 months and I've received absolutely no response .  This is one of 10 items I've posted and never received any feedback on whatsoever.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.