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
Support compound keys (<a-f>, <c-[>, etc.) in passkeys #1368
Conversation
# Keys are either literal characters, or "named" - for example <a-b> (alt+b), <left> (left arrow) or <f12> | ||
# This regular expression captures two groups: the first is a named key, the second is the remainder of | ||
# the string. | ||
namedKeyRegex = /^(<(?:[amc]-.|(?:[amc]-)?[a-z0-9]{2,5})>)$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to ignore case for named keys, i.e. treat <A-b>
in the same way as <a-b>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pinched from the background page, so (for now, at least) I think it's best leave as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it matters here, but case in keys matters since <A-b>
and <a-b>
are two different combinations and matching without case, would create weird ambiguity errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deiga are they different? I think <A-b>
and <a-b>
are same and both mean Alt+b
, while <a-B>
and <A-B>
both mean Alt+Shift+b
.
Update: I was talking about the conceptual idea in vim, not about the current implementation in vimium.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment we don't support capitalised modifiers for mappings. This regex is copied from there, for consistency.
If this is a bug, we can open a separate issue/PR and discuss it there.
@mrmr1993 it works fine for I took this branch, merged #1140 into it, updated vimium options with the following mapping: I enter |
@smblott-github this PR needs a rework, but is the idea a possibility? It's come back to mind based on #1560. |
@mrmr1993. I'm not sure I'm seeing a use case compelling enough to warrant the additional code and (more importantly) UI complexity. On most sites (GMail, etc), the important shortcuts are simple (ie. non modified), and most Vimium bindings are simple too. It may be better to wait and see what use cases emerge. |
@smblott-github Surely the only UI change is adding a small note to the help text by exclusions/passkeys in the options page? Or am I missing something?
Could those requests for |
Still not sure about this, @mrmr1993. |
Closing, @mrmr1993. I still don't think we should do this. Demand is weak. And we have |
This implements support for compound passkeys, which must be separated from other passkeys keys by a space. We require spaces since
<
and>
, since some people have bindings using them.This is a follow-up to an idea from the conversation on #1211.
@z0rch, @smblott-github, can you take a look, possibly in conjunction with #1140?