Skip to content

Commit 711ab1c

Browse files
committed
Use VirtualKeyCode instead of VirtualKey
1 parent feec280 commit 711ab1c

File tree

4 files changed

+9
-89
lines changed

4 files changed

+9
-89
lines changed

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/Editor_OutOfProc.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace Tvl.VisualStudio.MouseFastScroll.IntegrationTests
55
{
6+
using WindowsInput.Native;
7+
68
public class Editor_OutOfProc : TextViewWindow_OutOfProc
79
{
810
internal Editor_OutOfProc(VisualStudioInstance visualStudioInstance)
@@ -34,7 +36,7 @@ public void MoveCaret(int position)
3436
/// <summary>
3537
/// Sends key strokes to the active editor in Visual Studio. Various types are supported by this method:
3638
/// <see cref="string"/> (each character will be sent separately, <see cref="char"/>, and
37-
/// <see cref="VirtualKey"/>).
39+
/// <see cref="VirtualKeyCode"/>).
3840
/// </summary>
3941
public void SendKeys(params object[] keys)
4042
{

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/IntegrationHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace Tvl.VisualStudio.MouseFastScroll.IntegrationTests
1313
using System.Threading.Tasks;
1414
using Microsoft.VisualStudio;
1515
using Microsoft.Win32;
16+
using WindowsInput.Native;
1617
using Directory = System.IO.Directory;
1718
using DTE = EnvDTE.DTE;
1819
using IMoniker = Microsoft.VisualStudio.OLE.Interop.IMoniker;
@@ -414,10 +415,10 @@ private static string GetPrintableCharText(char ch)
414415

415416
private static void AppendVirtualKey(byte virtualKey, StringBuilder builder)
416417
{
417-
if (Enum.IsDefined(typeof(VirtualKey), virtualKey))
418+
if (Enum.IsDefined(typeof(VirtualKeyCode), virtualKey))
418419
{
419420
builder.Append('(');
420-
builder.Append(Enum.GetName(typeof(VirtualKey), virtualKey));
421+
builder.Append(Enum.GetName(typeof(VirtualKeyCode), virtualKey));
421422
builder.Append(") ");
422423
}
423424
}

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/SendKeys.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ internal void Send(object[] keys)
6161
inputSimulator.Keyboard.TextEntry(c);
6262
break;
6363

64-
case VirtualKey virtualKey:
64+
case VirtualKeyCode virtualKeyCode:
65+
inputSimulator.Keyboard.KeyPress(virtualKeyCode);
66+
break;
6567

6668
case null:
6769
throw new ArgumentNullException(nameof(keys));

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/VirtualKey.cs

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)