Skip to content

ModifierKeys

Summary

Specifies the set of modifier keys.

Signature

1
public enum ModifierKeys

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use the ModifierKeys
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class ModifierKeysSample : Indicator
     {
         private double _mouseBarIndex, _mousePrice;
         [Parameter(DefaultValue = Key.R)]
         public Key HotKey { get; set; }
         [Parameter(DefaultValue = ModifierKeys.Control)]
         public ModifierKeys HotKeyModifier { get; set; }
         protected override void Initialize()
         {
             Chart.MouseMove += Chart_MouseMove;
             Chart.MouseEnter += ResetMouseLocation;
             Chart.MouseLeave += ResetMouseLocation;
             ResetMouseLocation(null);
             Chart.AddHotkey(DrawLines, HotKey, HotKeyModifier);
         }
         private void ResetMouseLocation(ChartMouseEventArgs obj)
         {
             _mouseBarIndex = -1;
             _mousePrice = double.NaN;
         }
         private void Chart_MouseMove(ChartMouseEventArgs obj)
         {
             _mouseBarIndex = obj.BarIndex;
             _mousePrice = obj.YValue;
         }
         private void DrawLines()
         {
             if (_mouseBarIndex == -1 || double.IsNaN(_mousePrice)) return;
             Chart.DrawVerticalLine(_mouseBarIndex.ToString(), (int)_mouseBarIndex, Color.Red);
             Chart.DrawHorizontalLine(_mousePrice.ToString(), _mousePrice, Color.Red);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Fields

None

Summary

No modifiers are pressed.

Signature

1
public static ModifierKeys None;

Return Value

ModifierKeys

Alt

Summary

The ALT key.

Signature

1
public static ModifierKeys Alt;

Return Value

ModifierKeys

Control

Summary

The CTRL key.

Signature

1
public static ModifierKeys Control;

Return Value

ModifierKeys

Shift

Summary

The SHIFT key.

Signature

1
public static ModifierKeys Shift;

Return Value

ModifierKeys