question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some keys on Japanese layout keyboards are incorrectly interpreted as @

See original GitHub issue

Environment

PS version: 7.1.1
PSReadline version: 2.1.0
os: 10.0.19041.800 (WinBuild.160101.0800)
PS file version: 7.1.1.0
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 120
BufferHeight: 30

Exception report

N/A

Steps to reproduce

  1. Open powershell with Japanese layout keyboard.
  2. Press “無変換(Muhenkan)” key on keyboard.

Expected behavior

This is not character key - so nothing should happen and be displayed in console.

Actual behavior

Console prints @ key.

Backgrounds

I ran [console]::ReadKey() in pwsh and press “無変換(Muhenkan)” key.

KeyChar Key Modifiers
------- --- ---------
        29         0

Japanese is not an alphabet, so I use an IME - Input Method Editor (e.g. Microsoft IME) to type it. The “Muhenkan” key is for IME operation, so it does not send any characters.

It didn’t occur with the “半角/全角(Hankaku/Zenkaku)” key and the “変換(Henkan)” key for operating Japanese IME. However, if I press it together with the ALT key, the “@” will be displayed like “Muhenkan” key.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:11
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
cm3commented, Dec 21, 2021

https://github.com/PowerShell/PSReadLine/blob/15850a4e2ec4c74e31c222403f741532a2f46571/PSReadLine/Keys.cs#L206-L220

To add 0x1D (29) here will solve the problem. On the other hand, that constant should be available as ConsoleKey.NonConvert or such, so I added an issue to the .NET framework.

2reactions
cm3commented, Jan 7, 2022

I happened to find that using the new version of the Microsoft IME solve this problem in my environment. That IME had many bugs and I’ve used the previous version for a long time https://support.microsoft.com/en-us/windows/revert-to-a-previous-version-of-an-ime-input-method-editor-adcc9caa-17cb-44d8-b46e-f5b473b4dd77.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keyboard is typing wrong characters for Japanese language
Keyboard is typing wrong characters for Japanese language - Microsoft Community.
Read more >
How can I use the Japanese IME (Input Method Editor) with a
This is a big problem for users of non-English (and non-Japanese) keyboards since many keys (such as z and y, dashes and brackets...
Read more >
Keyboard keys are incorrectly assigned - Windows 10, 11
Symptom. Incorrect keys or characters are displayed when typing on the keyboard. For example, the H key is mapped as a backspace.
Read more >
How to change keyboard layout to fix problem of ... - YouTube
Hello friends, Today in this video we will see How to change keyboard language to fix problem of typing special character. because each ......
Read more >
Is it hard to get used to a Japanese keyboard layout, or ...
Depends on what you're going to do with it. A Japanese keyboard has several extra keys as modifiers compared to keyboards meant for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found