keymanapp / keyman

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

bug(windows): LDML keyboards do not appear to work correctly with Alt keys #12298

Open mcdurdin opened 3 months ago

mcdurdin commented 3 months ago

Originally posted by @dinakaranr in https://github.com/keymanapp/keyman/issues/12281#issuecomment-2311787527

rc-swag commented 3 weeks ago

It is failing in Windows because the LDML keyboard processor has not been fully implemented ldml_processor::get_key_list() it just returns an empty list.

In Windows the Keyman engine needs to register the interest in the preserved keys otherwise it will not be seen in the hook for the Keyman keyboard processor.

Implementation detail: Of interest with this example also is that the ALT key is in a keyboard rule via the the LDML rule other for modifiers. The get_key_list() will obviously have to do the logical expansion of the rule.

For more information The Call stack will be Keyman32Interface::GetKeyboardPreservedKeys MapKeyboard https://github.com/keymanapp/keyman/blob/ea6714956f0f97088773080f44c1d6e5969112dc/windows/src/engine/keyman32/preservedkeymap.cpp#L264

@srl295 Could you implement ldml_processor::get_key_list() ? Some of the necessary processing may already be being done in the ldml_processor when passing the keyboard rules.

srl295 commented 3 weeks ago

I see three of these that don't have any 'interesting' implementation. i'll check over the docs.

    km_core_context_item * get_intermediate_context() override;
    km_core_keyboard_key  * get_key_list() const override;
    km_core_keyboard_imx  * get_imx_list() const override;
mcdurdin commented 2 weeks ago

get_intermediate_context and get_imx_list are only really relevant for IMX, which LDML keyboards do not support.

srl295 commented 1 hour ago

Trying to repro the failing case. Windows 11. Keyman 18.0.116-alpha (will update and try again). Notepad.