Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vs-editor-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Editor/Text/Def/TextUICocoa/Input/KeyEvent.cs')
-rw-r--r--src/Editor/Text/Def/TextUICocoa/Input/KeyEvent.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Editor/Text/Def/TextUICocoa/Input/KeyEvent.cs b/src/Editor/Text/Def/TextUICocoa/Input/KeyEvent.cs
new file mode 100644
index 0000000..eab7599
--- /dev/null
+++ b/src/Editor/Text/Def/TextUICocoa/Input/KeyEvent.cs
@@ -0,0 +1,34 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+
+using System;
+using AppKit;
+
+namespace Microsoft.VisualStudio.Text.Editor
+{
+ /// <summary>
+ /// A native <see cref="NSEvent"/> key input event that allows for indicating that
+ /// the event has been handled. This event will wrap <see cref="NSEventType.KeyUp"/>,
+ /// <see cref="NSEventType.KeyDown"/>, and <see cref="NSEventType.FlagsChanged"/>
+ /// events.
+ /// </summary>
+ public sealed class KeyEvent : InputEvent
+ {
+ internal KeyEvent(NSEvent @event) : base(@event)
+ {
+ switch (@event.Type)
+ {
+ case NSEventType.KeyUp:
+ case NSEventType.KeyDown:
+ case NSEventType.FlagsChanged:
+ break;
+ default:
+ throw new ArgumentException(
+ "event type must be KeyUp, KeyDown, or FlagsChanged",
+ nameof(@event));
+ }
+ }
+ }
+} \ No newline at end of file