Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting control of the Arrow Keys in NinjaScript -- C# Guru, do you know?

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

    Getting control of the Arrow Keys in NinjaScript -- C# Guru, do you know?

    I had this question in another thread, but will repost here with a different direction....

    In NT7 I could use the Up and Down arrow keys in NinjaScript Indicator. But NT8 has reserved them for what is to me trivial use. (just an opinion)

    I already know the answer I'll get from Ninja, but perhaps one of you C# gurus can tell me...how can I get control of the Up and Down arrow keys in Ninjascript Indicator.

    Would it be possible to do put a ChartControl in an AddOn with code to disable all instances of ChartControl (only the ChartControl, not ChartTrader, etc) architecture from trapping the keypress on these keys?

    Not sure how to do that...

    ??



    #2
    Hello llanqui,

    Thanks for your post.

    This would fall outside of the realm of support by NinjaTrader.

    However, there is an example of this on the forums which I am linking below.
    https://ninjatrader.com/support/foru...688#post505688

    The example is only designed to show how to interpret ascii keys.

    You would only need the key command for the sequence you are after.

    This example does not show how to interpret every combination on the key board. It only provides a general outline of how key presses would be intercepted and interpreted.

    This forum thread will also be open for other community members to share their insights on the topic.​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      (to the C# guys)

      Not sure if that would work for the arrow keys?

      What I need to do is only for a Chart Panel, not Chart Trader, or other controls, to capture the up/down arrow keys.

      These keys are different than most other keys in WPF I understand .

      Maybe I should add a ChartPanel to an AddOn and then pass through any use of the Arrow Keys...any ideas?

      Would that make it Global?

      Comment


        #4
        Hello llanqui,

        Thanks for your notes.

        Unfortunately, this goes outside of the support we would be able to provide you with in the NinjaTrader Support department.

        This forum thread will be open for other community members to share their insights on unsupported C# advanced code to accomplish this.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Yes, I'm addressing the comments here to other developers...thank you.

          I'm going to try this....make a new AddOn and in OnWindowCreated, if the new window is a Chart, then I will attach Key events to the ChartPanel. I hope this way I can pass through the Arrow events to any indicators instead of them being trapped in the Ninja Architecture

          I only want the Up/Down arrows from the ChartPanel, when it has focus...not other objects such as ChartTrader (side panel) or Toolbar Menus, etc.

          Comments?

          Comment


            #6
            Ok, well I have a non Ninjascript solution that is working well... I am using Hotkeyboard, a hot key manager, to capture the Ctl-DownArrow and the Shift-UpArrow

            this gets control before Ninja, evidently, of the Arrow Keys

            is working well

            so the solution is to get a keyboard hook before Ninja gets it

            too bad I had to spend all this time...cause the way Ninja 8 uses/reserves the arrow keys is trivial and for almost all traders, unnecessary


            the other method might be to attach keyboard evens to the ChartPanel, but the control is not exposed and it would take time to find out if it was possible

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            579 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X