Closed EtiamNullam closed 1 year ago
Most likely caused by #95. The problem is that AltGr is represented as Alt+Ctrl on Windows so there isn't a way to distinguish between the two. One way to fix this would be to ignore Ctrl when Alt is also pressed, although if we did that it wouldn't be possible to bind keys combinations like <C-A-[key]>.
https://github.com/RMichelsen/Nvy/blob/c1628ec5d4f8f430cd0d61a9e831766d4976e7af/src/main.cpp#L232
diff --git a/src/main.cpp b/src/main.cpp
index 9faa38b..8821b1c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -227,9 +227,10 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
}
}
+ bool altgr_down = (GetKeyState(VK_RMENU) & 0x80) != 0;
bool ctrl_down = (GetKeyState(VK_CONTROL) & 0x80) != 0;
wchar_t wchar = static_cast<wchar_t>(MapVirtualKeyEx(wparam, MAPVK_VK_TO_CHAR, context->hkl));
- if (ctrl_down && wchar) {
+ if (!altgr_down && ctrl_down && wchar) {
NvimSendSysChar(context->nvim, wchar);
return 0;
}
This solves the problem for me. YMMV.
@rehael That seems like a good solution, certainly better than how it currently works, probably worth a PR.
PR linked. But frankly I'm not especially proud of that quick hack. ;)
Yes unfortunately the key handlings is hacky in general atm, but I agree this is probably an improvement for now :), merging.
Attempting to enter Polish diacritic characters just exits the insert mode instead of inserting them.
For example I would use
ALT+L
to getŁ
. If I pressCTRL-V
to insert them as they are and attempting to insertALT+L
I will receive<M-C-L>
, while onv0.3.6
on US layout<M-L>
would be printed, and desired character appears on Polish layout. Seems likeNvy
wrongly assumes thatCTRL
is also held.Seems like its a regression bug that appeared in
0.3.7
,0.3.6
is fine.