Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support language input keys #63034

Open
cm3 opened this issue Dec 21, 2021 · 10 comments
Open

Support language input keys #63034

cm3 opened this issue Dec 21, 2021 · 10 comments
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-System.Console
Milestone

Comments

@cm3
Copy link

cm3 commented Dec 21, 2021

Language input keys are not defined in

That causes issues like PowerShell/PSReadLine#2206.

So I recommend ConsoleKey to include:

  • Convert / 28 / 0x1C
  • NonConvert / 29 / 0x1D

Virtual-Key Codes (Winuser.h) - Win32 apps | Microsoft Docs lists up other language input keys, too. And, according to the entry in Windows Blog for Japan (Japanese), codes below also should be added.

  • ImeOn / 22 / 0x16
  • ImeOff / 26 / 0x1A
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Console untriaged New issue has not been triaged by the area owner labels Dec 21, 2021
@ghost
Copy link

ghost commented Dec 21, 2021

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

Issue Details

Language input keys are not defined in

That causes issues like PowerShell/PSReadLine#2206.

So I recommend ConsoleKey to include:

  • Convert / 28 / 0x1C
  • NonConvert / 29 / 0x1D

Virtual-Key Codes (Winuser.h) - Win32 apps | Microsoft Docs lists up other language input keys, too. And, according to the entry in Windows Blog for Japan (Japanese), codes below also should be added.

  • ImeOn / 22 / 0x16
  • ImeOff / 26 / 0x1A
Author: cm3
Assignees: -
Labels:

area-System.Console, untriaged

Milestone: -

@huoyaoyuan
Copy link
Member

The following API is proposed:

namespace System
{
    enum ConsoleKey
    {
        Convert = 0x1C, // or named as ImeConvert
        NonConvert = 0x1D, // or named as ImeNonConvert
        ImeOn = 0x16,
        ImeOff = 0x1A,
    }
}

@huoyaoyuan huoyaoyuan added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Dec 21, 2021
@cm3
Copy link
Author

cm3 commented Jan 8, 2022

Winforms use IMEConvert and IMENonconvert for the API names and the same names can be preferred. https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms/src/System/Windows/Forms/Keys.cs

@danmoseley
Copy link
Member

In the public winforms enum linked I notice a typo: "IMEAceept"..

@cm3
Copy link
Author

cm3 commented Jan 9, 2022

@danmoseley That is for backward compatibility.

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.keys?view=windowsdesktop-6.0&viewFallbackFrom=net-5.0 says "The IME accept key. Obsolete, use IMEAccept instead."

A comment in http://www.mikepope.com/blog/AddComment.aspx?blogid=2250 explains the history:

I found System.Windows.Forms.Keys.ImeAceept (ImeAccept) after we shipped it. After that, I put in a test for exposed interface on the windows forms stuff. Every time the interface changed, the test would fail, and I'd have to go look at it and make sure everything was cool. I filed over a dozen bugs on new spelling errors in the interface as a result of the test...

@adamsitnik adamsitnik removed the untriaged New issue has not been triaged by the area owner label Jan 10, 2022
@adamsitnik
Copy link
Member

For now I've added this issue to #52374, will try to tackle it when we start working on improving Console

@jeffhandley jeffhandley added this to the Future milestone Jul 10, 2022
@adamsitnik
Copy link
Member

Is it possible to recognize them on Unix?

@cm3
Copy link
Author

cm3 commented Nov 18, 2023

Are you making a distinction between Linux and Unix in your statement? If not, I am happy to report that those keys are recognised on Ubuntu. If so, please wait for another report from someone.

@adamsitnik
Copy link
Member

I am happy to report that those keys are recognised on Ubuntu

Is there any chance you could run showkey -a command line utility and press that key to see what it's being mapped to?

I've used it in https://devblogs.microsoft.com/dotnet/console-readkey-improvements-in-net-7/#sys-calls

@cm3
Copy link
Author

cm3 commented Apr 7, 2024

I apologize for the significant delay in responding to your inquiry regarding the key recognition issue on Linux. After finally conducting the tests you suggested, I have some results to share.
Unfortunately, the showkey -a command did not register any response for either of the keys in question. However, by using the xev command, I was able to determine that the Non Convert key is recognized as keycode 102 (keysym 0xff22, Muhenkan) and the Convert key as keycode 100 (keysym 0xff23, Henkan_Mode).
The PC with Ubuntu installed, on which I intended to perform these tests, was no longer operational. In its place, I've found another PC running Peppermint Linux, which I used to conduct the tests and gather this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-System.Console
Projects
None yet
Development

No branches or pull requests

5 participants