Skip to content

Key mappings for Shift + [non-printable char key] #2388

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

Closed
wants to merge 3 commits into from

Conversation

alexei-zayakin
Copy link

@alexei-zayakin alexei-zayakin commented Dec 29, 2016

Currently it is impossible to create a key mapping for combinations like Shift + Left or Shift + F1.

Proposed changes make it possible using <s-left> syntax.

@gdh1995
Copy link
Contributor

gdh1995 commented Jan 1, 2017

I agree that <Shift+Fn> should be supported, but I think <f1> / <F1> and <left> / <LEFT> are better than a new modifier s.

@alexei-zayakin
Copy link
Author

Currently, <left> / <f1> are case insensitive, thus I thought a new modifier would be better than changing behavior for some existing combinations.

Anyways, I am completely okay with any implementation, just want to use that feature.

@smblott-github
Copy link
Collaborator

@gdh1995... I prefer this to #2390. Suggest we do this a close the other one.

@gdh1995
Copy link
Contributor

gdh1995 commented Mar 4, 2017

Well, this indeed seems a good solution.

My PR is from my project Vimium++, and it has supported keys like <LEFT> for years. @smblott-github, since users of Vimium are so much more than those of mine extension, what Vimium chooses is up to you. I'll change Vimium++ to make it support <s-*> too.

Updated: the master branch of Vimium++ has supported auto-conversion from <s-left> to <LEFT>.

@sluongng
Copy link

sluongng commented Jan 5, 2019

could we pls have this?

@gdh1995
Copy link
Contributor

gdh1995 commented Apr 6, 2019

Now I've given up my idea of <LEFT> and turned to this PR of <s-left>.

@philc
Copy link
Owner

philc commented Jan 12, 2020

@gdh1995 @alexei-zayakin I'd like to merge this if it can be updated to merge cleanly (the code has changed since original authoring). Ideally we also have a test case for this in commands_test.coffee.

@gdh1995
Copy link
Contributor

gdh1995 commented Jan 12, 2020

Oh this is safe to merge.

The conflicting line is keyChar = keyChar.toUpperCase() if event.shiftKey and keyChar.length == 1, which "has been added" into the master branch.

@philc
Copy link
Owner

philc commented Feb 24, 2020

Merged in ebc57ba. Nice. Thanks!

@politicus
Copy link

What a great news! More mappings available!

Can we get a list of the keys that now can be mapped the following way ?

I tried and successfully mapped the four arrow keys:
map LinkHints.activateMode action=copy-text
map LinkHints.activateMode action=hover
map LinkHints.activateMode action=focus
map LinkHints.activateMode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants