forked from ElectronNET/Electron.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputEvent.cs
More file actions
162 lines (134 loc) · 5.8 KB
/
Copy pathInputEvent.cs
File metadata and controls
162 lines (134 loc) · 5.8 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
using System.Collections.Generic;
namespace ElectronNET.API.Entities
{
using ElectronNET.Converter;
using System.Text.Json.Serialization;
/// <summary>
/// Input event payload as used by webContents 'input-event' and 'before-input-event'.
/// Fields map to KeyboardEvent properties where noted, and type/modifiers follow Electron's InputEvent structure.
/// </summary>
/// <remarks>Up-to-date with Electron API 39.2</remarks>
public class InputEvent
{
/// <summary>
/// Equivalent to KeyboardEvent.key.
/// </summary>
public string Key { get; set; } = "";
/// <summary>
/// Equivalent to KeyboardEvent.code.
/// </summary>
public string Code { get; set; } = "";
/// <summary>
/// Equivalent to KeyboardEvent.repeat.
/// </summary>
public bool IsAutoRepeat { get; set; } = false;
/// <summary>
/// Equivalent to KeyboardEvent.isComposing.
/// </summary>
public bool IsComposing { get; set; } = false;
/// <summary>
/// Equivalent to KeyboardEvent.shiftKey.
/// </summary>
public bool Shift { get; set; } = false;
/// <summary>
/// Equivalent to KeyboardEvent.controlKey.
/// </summary>
public bool Control { get; set; } = false;
/// <summary>
/// Equivalent to KeyboardEvent.altKey.
/// </summary>
public bool Alt { get; set; } = false;
/// <summary>
/// Equivalent to KeyboardEvent.metaKey.
/// </summary>
public bool Meta { get; set; } = false;
/// <summary>
/// Equivalent to KeyboardEvent.location.
/// </summary>
public int Location { get; set; } = 0;
/// <summary>
/// An array of modifiers of the event, can be `shift`, `control`, `ctrl`, `alt`,
/// `meta`, `command`, `cmd`, `iskeypad`, `isautorepeat`, `leftbuttondown`,
/// `middlebuttondown`, `rightbuttondown`, `capslock`, `numlock`, `left`, `right`.
/// </summary>
[JsonConverter(typeof(ModifierTypeListConverter))]
public List<ModifierType> Modifiers { get; set; }
/// <summary>
/// For MouseInputEvent: The x-coordinate of the event (Integer).
/// </summary>
public int? X { get; set; }
/// <summary>
/// For MouseInputEvent: The y-coordinate of the event (Integer).
/// </summary>
public int? Y { get; set; }
/// <summary>
/// For MouseInputEvent: The button pressed, can be 'left', 'middle', or 'right' (optional).
/// </summary>
public string Button { get; set; }
/// <summary>
/// For MouseInputEvent: Global x in screen coordinates (Integer, optional).
/// </summary>
public int? GlobalX { get; set; }
/// <summary>
/// For MouseInputEvent: Global y in screen coordinates (Integer, optional).
/// </summary>
public int? GlobalY { get; set; }
/// <summary>
/// For MouseInputEvent: Movement delta on x-axis since last event (Integer, optional).
/// </summary>
public int? MovementX { get; set; }
/// <summary>
/// For MouseInputEvent: Movement delta on y-axis since last event (Integer, optional).
/// </summary>
public int? MovementY { get; set; }
/// <summary>
/// For MouseInputEvent: Click count (Integer, optional).
/// </summary>
public int? ClickCount { get; set; }
/// <summary>
/// For MouseWheelInputEvent: Horizontal scroll delta (Integer, optional).
/// </summary>
public int? DeltaX { get; set; }
/// <summary>
/// For MouseWheelInputEvent: Vertical scroll delta (Integer, optional).
/// </summary>
public int? DeltaY { get; set; }
/// <summary>
/// For MouseWheelInputEvent: Horizontal wheel ticks (Integer, optional).
/// </summary>
public int? WheelTicksX { get; set; }
/// <summary>
/// For MouseWheelInputEvent: Vertical wheel ticks (Integer, optional).
/// </summary>
public int? WheelTicksY { get; set; }
/// <summary>
/// For MouseWheelInputEvent: Horizontal acceleration ratio (Integer, optional).
/// </summary>
public int? AccelerationRatioX { get; set; }
/// <summary>
/// For MouseWheelInputEvent: Vertical acceleration ratio (Integer, optional).
/// </summary>
public int? AccelerationRatioY { get; set; }
/// <summary>
/// For MouseWheelInputEvent: True if wheel deltas are precise (optional).
/// </summary>
public bool? HasPreciseScrollingDeltas { get; set; }
/// <summary>
/// For MouseWheelInputEvent: True if the target can scroll (optional).
/// </summary>
public bool? CanScroll { get; set; }
/// <summary>
/// Can be `undefined`, `mouseDown`, `mouseUp`, `mouseMove`, `mouseEnter`,
/// `mouseLeave`, `contextMenu`, `mouseWheel`, `rawKeyDown`, `keyDown`, `keyUp`, `char`,
/// `gestureScrollBegin`, `gestureScrollEnd`, `gestureScrollUpdate`,
/// `gestureFlingStart`, `gestureFlingCancel`, `gesturePinchBegin`,
/// `gesturePinchEnd`, `gesturePinchUpdate`, `gestureTapDown`, `gestureShowPress`,
/// `gestureTap`, `gestureTapCancel`, `gestureShortPress`, `gestureLongPress`,
/// `gestureLongTap`, `gestureTwoFingerTap`, `gestureTapUnconfirmed`,
/// `gestureDoubleTap`, `touchStart`, `touchMove`, `touchEnd`, `touchCancel`,
/// `touchScrollStarted`, `pointerDown`, `pointerUp`, `pointerMove`,
/// `pointerRawUpdate`, `pointerCancel` or `pointerCausedUaAction`.
/// </summary>
public InputEventType Type { get; set; }
}
}