[vim/vim] Kana key doesn't work in gvim (Issue #10784)

5 views
Skip to first unread message

benjaminlawetz

unread,
Jul 25, 2022, 11:04:40 AM7/25/22
to vim/vim, Subscribed

Steps to reproduce

Using an US keyboard layout modified with the CAPS LOCK replace by KANA and I mapped french accents to a KANA+letter.
when typing a KANA+letter, it doesn't show up.

Expected behaviour

Typing CAPSLOCK+e should give 'ê' according to my keyboard mapping (works in all other windows apps)

Version of Vim

9.0.0065

Environment

Windows 10 21H2

Logs and stack traces

This worked in 8.2.4803 and did not work in 8.2.4807 (and anything after that).

The issue is in gvim, vim behaves as expected.

Obviously in my other windows applications (ie: notepad,chrome) this works.

Using KbdEdit to for the KANA mapping.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10784@github.com>

ant0sha

unread,
Jul 25, 2022, 1:50:03 PM7/25/22
to vim/vim, Subscribed

(By chance i was working on PR (#10687) to fix something after same commit.)

Main difference in that commit (8.2.4803) was that instead of relying on WIN32 API TranslateMessage() call to interpret the WM_KEYDOWN and convert them in a sequence of WM_CHAR events, we began to simulate that call via sequence of following:

// Translate the virtual key according to the current keyboard
// layout.
scan_code = MapVirtualKey(vk, MAPVK_VK_TO_VSC); // Convert the scan-code into a sequence of zero or more unicode
// codepoints.
// If this is a dead key ToUnicode returns a negative value.
len = ToUnicode(vk, scan_code, keyboard_state, ch, ARRAY_LENGTH(ch), 0);

Those calls create translated unicode character(s?), which are entered by user, inside buffer, pointed by "ch". It is supposed to work for the cases of "official" shift keys only, as far as i understand it - i.e. Shift/Alt/Ctrl. Chord of arbitrary other buttons is not manageable in that way - may be for KANA key it would be still possible to get desired 'ê' respond from ToUnicode() - but it would need to make KANA generally recognized Shift-like modifier?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10784/1194410092@github.com>

Bram Moolenaar

unread,
Jul 27, 2022, 8:01:11 AM7/27/22
to vim/vim, Subscribed

@LemonBoy


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10784/1196636618@github.com>

Reply all
Reply to author
Forward
0 new messages