Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Keyboard input

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

    Keyboard input

    I want to use keyboard input in my c# scripts in order to test out my strategies

    For example

    if (Keyboard.IsKeyDown(Key.X))
    {
    Print("Hello");
    }

    I'm getting an error.. Is there a conflict with a namespace?

    #2
    Hello DuggyLou,

    Thank you for the post.

    There is an existing sample you can use as a references for handling key events in NinjaScript. This is not specific to NinjaScript and you would be using the C#/WPF keyboard events here. That also entails this is not a documented subject but you can find samples on the forum by searching for specific events.

    In the linked post the PreviewKey events are being used from a textbox to handle key presses however the same concepts would be applied to the control you are targeting such as a window or the ChartControl.




    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    23 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X