keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
376 stars 104 forks source link

feat(web): add support for the English (India) keyboard for Windows to switch to Alt Gr layer on Keymanweb #10890

Open Meng-Heng opened 3 months ago

Meng-Heng commented 3 months ago

Is your feature request related to a problem? Please describe.

When trying to switch to the Right Alt or Alt Gr layer with the Malayalam basic keyboard on Keymanweb using the English (India) keyboard for Windows, the Alt Gr layer does not show up. Only when clicking on the OSK, does it work.

The original post - https://community.software.sil.org/t/input-handling-in-keyman-web-with-the-windows-english-india-keyboard/8466/3

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Related issues

No response

Keyman apps

Keyman version

16.0.145 stable & 17.0.278 beta

Operating system

Windows 10 Home version 2004 & Windows 11 Home Single Language version-23H2

Device

Windows laptop

Target application

No response

Browser

Chrome v 122.0.6261.70, Firefox v 123.0 (64-bit), and Microsoft Edge v 122.0.2365.52

Keyboard name

basic_kbdinmal

Keyboard version

1.1

Language name

Malayalam

Additional context

No response

jahorton commented 3 months ago

On the English (India) Windows keyboard, pressing the right Alt key gives me both ControlLeft and AltRight in a single keypress (as seen by e.code)... which is NOT the same as ControlLeft+AltLeft, the combination we support.

Note: that seems to be the specific ordering.

jahorton commented 3 months ago

More significantly(?) - getModifierState for that AltRight suggests that it's disabled... even on key-down. As a result, KeymanWeb doesn't detect any Alt - it's based on getModifierState - so AltGr emulation doesn't get a chance to trigger.

In the meantime, we do get e.code == AltRight. If we partially address #309 by considering e.code when it exists, that could give us a pretty decent way foward.

ramesh-k commented 3 months ago

Below are some additional points I noted in connection with this issue.

  1. In Microsoft Keyboard Layout Creator 1.4, I loaded both English (India) keyboard and the US keyboard. In properties of keyboard, the option Right Alt treated as Ctrl+Alt (Also known as AltGr) is enabled only in the case of English (India) keyboard.

    image

    image

  2. When attempting to switch to the AltGr layer by clicking Left Ctrl+Left Alt with the Malayalam basic keyboard on Keymanweb using the English (India) keyboard for Windows 11 Home Single Language (Version-23H2), the AltGr layer appears. However, it does not work identically in different web browsers. Test results are provided below:"