Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Shortcut Key Functionality for Addons

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Shortcut Key Functionality for Addons

    I followed the help guide to create menu items for addons. How do I set it up so that shortcut keys can be optionally assigned to those menu items?

    #2
    Hello ntbone,

    Thank you for the post.

    Currently there is no framework exposed for NinjaScript to manage hotkeys so in this situation you would need to use the preview key events to monitor key events and then handle the events you needed. Preview key events are not a NinjaScript concept so this is not something we have a sample or documentation for, you can research this topic on MSDN in contrast to WPF controls. You can also find a sample that was uploaded to the forum of a text box that handles key events which would be a similar process to what you would need: https://ninjatrader.com/support/foru...PreviewKeyDown
    Depending on where you wanted this code to be executed you would need to subscript to that controls preview key events to observe key events when that control is in focus.

    Please let me know if I may be of further assistance.

    Comment


      #3
      So custom drawing tools can have short cut keys because your code generates the menu items but short cut keys for menu items we add cannot take advantage of the shortcut framework you already put in place?

      Comment


        #4
        Hello ntbone,

        You have understood correctly, the hotkey manager has logic to look for drawing objects so they can have hotkeys added like the existing drawing objects. The hotkey manager was otherwise not exposed for NinjaScript use so other types which are not specifically drawing objects wont be able to take advantage of that. You can use the preview key events from other types to capture keys but the existing hotkey manager has no supported solutions for adding custom hotkeys right now.


        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        606 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        353 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        560 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        561 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X