• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Monitor for Up/Down Arrow Key

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

    Monitor for Up/Down Arrow Key

    I would like to be able to monitor for the up/down arrow key being pressed (or any key for that matter). I tried to hook the chart window PreviewKeyDown handler, but that did not seem to do the trick. Do I need to hook a different component/handler? Thanks.

    #2
    Hello aslane,

    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
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Well that example does not work, as it will not trap arrow keys.

      Comment


        #4
        Hello aslane,

        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.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Yes, I understand the general concept, was only pointing out that this example is useless because the arrow keys are kind of special because they are navigation keys (not just ascii). I understand that I need to look for the arrow keycode, but the real issue is how to properly tap into the event hierarchy. The up/down arrow keys get routed off to the chart scale. So to properly monitor for them you need to tap fairly early in the hierarchy. I suspected you would not support it (and that is totally ok), but was hoping for a hint, as I have tapped into this event everywhere that I could find with no luck.

          Comment


            #6
            YMMV, but attaching to top level Chart object seems to do the trick.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NinjaCustomer, Today, 10:06 AM
            3 responses
            7 views
            0 likes
            Last Post NinjaTrader_JoshG  
            Started by crabman777, Today, 09:52 AM
            3 responses
            12 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Arkadiy_B, Today, 06:43 AM
            0 responses
            4 views
            0 likes
            Last Post Arkadiy_B  
            Started by leontancfa, Today, 06:09 AM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by soulfx, 12-01-2017, 08:44 AM
            3 responses
            1,023 views
            0 likes
            Last Post NinjaTrader_EricB  
            Working...
            X