Skip to content

Something wrong with keyboard modifiers processing? #1694

@igorkuzuro

Description

@igorkuzuro

Something wrong with keyboard modifiers processing?

We have wrong processing of keyboard input with modifiers... For example:

using System;

namespace ConsoleApp1
{
	class Program
	{
		static void Main(string[] args)
		{
			ConsoleKeyInfo cki;
			do
			{
				cki = Console.ReadKey();
				Console.Write(" --- You pressed ");
				if ((cki.Modifiers & ConsoleModifiers.Alt) != 0)
				{
					Console.Write("ALT+");
				}
				if ((cki.Modifiers & ConsoleModifiers.Shift) != 0)
				{
					Console.Write("SHIFT+");
				}
				if ((cki.Modifiers & ConsoleModifiers.Control) != 0)
				{
					Console.Write("CTL+");
				}
				Console.WriteLine(cki.Key.ToString());
			}
			while (cki.Key != ConsoleKey.Escape);
		}
	}
}

Same keys sequence is pressed... 1 2 ... 0 RCtrl+1 RCtrl+2 RCtrl+3... RCtrl+0
LCtrl+1 LCtrl+2 LCtrl+3 LCtrl+4

We have some, but also wrong result only for Ctrl+2... Shift modifier added.

image

Same behaviour also with more complicated software - "Far Manager" for example (in this situation problem not with simple Console.ReadKey but with keyboard events processing. In this example we don't see any reactions of software on pressing Ctrl like we can see in old console. So problems also with keyboard modifiers).

Metadata

Metadata

Assignees

Labels

Area-InputRelated to input processing (key presses, mouse, etc.)Area-VTVirtual Terminal sequence supportIssue-BugIt either shouldn't be doing this or needs an investigation.Product-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions