Divelements Community
Customer discussion of all Divelements products

Dual shortcuts

Latest post 06-28-2007 10:45 by obzekt. 2 replies.
  • 06-28-2007 9:26

    Dual shortcuts

    Hello. I have a requirement for a menu item to invoke a special function with the Shift key. In other words, when F12 (which is the primary shortcut) is hit it does function A and when Shift+F12 is hit it does a variation of function A. An idea is to create a second menu item and set its Shortcut to Shift+F12, but I don't really want to expose that menu, it is an undocumented-type of feature. Any ideas?
  • 06-28-2007 10:30 In reply to

    • Eivind
    • Top 50 Contributor
    • Joined on 12-23-2005
    • Norway
    • Posts 18

    Re: Dual shortcuts

    There may be another way, but you could always create two similar menu items with different event handlers, and just before the menu is shown you could do something like this:

    if( (Control.ModifierKeys & Keys.Shift) == Keys.Shift )
      // remove standard item, and add the special item
    else
     //remove special item, and add the default item
  • 06-28-2007 10:45 In reply to

    Re: Dual shortcuts

    Thanks for your reply. Actually it seems I don't really need to do that. I can create a second menu with Shortcut=ShiftF12 and set programmatically Visible=False and it does what I want. It is hidden but the shortcut still gets processed.
Page 1 of 1 (3 items) | RSS
Copyright © 2008 Divelements Limited
Powered by Community Server (Commercial Edition), by Telligent Systems