Skip to content

use upper-case key names to represent shiftKey in <([acm]-)?.*> key mappings #2390

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 2 commits into from

Conversation

gdh1995
Copy link
Contributor

@gdh1995 gdh1995 commented Jan 3, 2017

This is another solution to #2388, and allows users to make such key mappings:

# press "Space"
map <space> scrollDown
# press "Shift+Space"
map <SPACE> scrollUp

# just treated as "<space>"
map <Space> scrollDown

The added logic is that if a keyChar (background_scripts/commands.coffee#L75) has only upper-case chars, then it means Shift should be pressed.

This does not influence most old mappings like <Left>, but will treat <f1> and <F1> differently.

@smblott-github
Copy link
Collaborator

Treating <f1> and <F1> differently would be problematic, would it not, since a fair few users will already have mappings for <F1>, which do not require the Shift key?

Is #2388 not more vim like too?

@gdh1995
Copy link
Contributor Author

gdh1995 commented Jan 3, 2017

But the difference between <a> and <A> is just the shiftKey, and Vimium does not accept <s-a>.

I have no good idea about <F1>. Maybe we can add a function in runtime.onInstalled to detect old mappings and convert them?

@lydell
Copy link

lydell commented Jan 4, 2017

Shameless plug: You could also use https://github.com/lydell/vim-like-key-notation for inspiration (which is used by VimFx).

@gdh1995
Copy link
Contributor Author

gdh1995 commented Apr 6, 2019

I'm giving up this idea, because now I find that, usually a key like Alt+Shift+C should not be influenced by the Caps Lock key...

@gdh1995 gdh1995 closed this Apr 6, 2019
@gdh1995 gdh1995 deleted the ctrl-shift-key-mapping branch August 19, 2019 03:16
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.

3 participants