-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot map <A-...> on macos #579
Comments
#510 (comment) He also mentioned such problems. |
I found that was internally converted to <A- ̊>. |
That is the macOS default behavior. Though I would expect Qt to give nvim-qt the proper flags, and then nvim-qt just composes a |
This is interesting behavior from MacOS... From my tests, From
The input is handled this way because MacOS generates I'm not sure it is possible to handle this case. How can we identify the user's intent as You could change the keyboard layout to Unicode Hex Input: However, even with the alternate layout MacOS still generates odd key events
|
@mikew Moving the discussion from Pull Request 612 here. I am still somewhat hesitant on this issue... The current behavior isn't strictly invalid. I wonder if there is a good way to make the The best approach so far:
We can define such a function for each platform in For platforms where the existing behavior is good, we can simply use:
|
It's still super weird though. With
The second if statement in there, setting text where Qt otherwise removes it on macOS, doesn't have parity with |
Agreed, sending After investigating 510 further, I think the correct behavior is to send This is an oversimplified fix for 510: diff -r a4b43d295f61 src/gui/shell.cpp
--- a/src/gui/shell.cpp Mon Dec 16 02:23:57 2019 -0500
+++ b/src/gui/shell.cpp Thu Dec 26 10:58:19 2019 -0500
@@ -1070,6 +1070,8 @@
this->setCursor(Qt::BlankCursor);
}
+ qDebug() << "QKeyEvent ev:" << ev;
+
const QString inp = Input::convertKey(ev->text(), ev->key(), ev->modifiers());
if (inp.isEmpty()) {
QWidget::keyPressEvent(ev); Even with modification, the fix for 510 will impact this scenario. I hope we can fix this issue (579) by finding a keyboard layout like
LOL, that is obvious in hindsight. I was too focused on carefully refactoring the existing code. |
This issue is resolved with the latest release The default behavior of However with |
For others who find this looking for an answer, in addition to @jgehrig excellent suggestion above, which works wonderfully, you should also consider turning on |
that's awesome |
Environment
Reproduce Step
/Applications/nvim-qt.app/Contents/MacOS/nvim-qt -- -u NONE
:map <A-k> :echo "hello"<CR>
<A-k>
By the way, I found
<c-a-k>
can be mapped.The text was updated successfully, but these errors were encountered: