Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Multi-keystroke patterns can't be created solely out of modifier keys. (like 'shift shift') #21

Open
krilnon opened this issue May 17, 2014 · 38 comments

Comments

@krilnon
Copy link

krilnon commented May 17, 2014

It's hard to tell if this is by design or not, but I wanted to make a double tap of the shift key open the autocomplete menu. This approach works for doubled special keys and character literals, so I expected it to work for modifiers too.

Doesn't work:

'.editor':
  'shift shift': 'command-palette:toggle'

Does work:

'.editor':
  'escape escape': 'command-palette:toggle'
'.editor':
  'x x': 'command-palette:toggle'

(I toggled the command palette in these examples but the same applies for autocomplete, etc.)

Is this broken or by design? And if it's by design, why?

Thanks! 🐹

@nathansobo
Copy link
Contributor

This is by design for now, but we may be able to support it. I excluded bare modifiers out of concern for ambiguity between the user hitting a modifier alone and the user hitting a modifier as part of a modified normal keystroke. When you press shift-a for example, there will actually be two keydown events, one for the shift and another for the shift-a. So bare modifier patterns would always end up matching the first keydown event and interfering with other modified bindings, which is probably not what you want.

I think we could probably match bare modifiers on keyup, when we can be sure there's no incoming modified keystroke.

@adamclerk
Copy link

I'd love to see this feature. I'm trying to do the same thing as @krilnon with the back to back shift.

@msjyoo
Copy link

msjyoo commented Dec 5, 2014

+1 to this feature

@bramcordie
Copy link

Is it possible to configure around this design limitation? I'm used to double tapping ⇧ to launch Search Everywhere in PhpStorm. I would like atom to behave the same way with the following binding:

'.editor':
  'shift shift': 'fuzzy-finder:toggle-file-finder'

@blmarket
Copy link

Also IntelliJ(seems most of JetBrains IDEs) also supports ⬆️ ⬆️ to 'Search Everywhere'

@ilyashubin
Copy link

+1

5 similar comments
@cakebake
Copy link

+1

@blackfyre
Copy link

👍

@shaunhAU
Copy link

+1

@roelentless
Copy link

+1

@remcohh
Copy link

remcohh commented Oct 2, 2015

+1

@nunobaba
Copy link

nunobaba commented Oct 3, 2015

+1
Would it imply a lot of changes to implement this?

@nathansobo
Copy link
Contributor

Would it imply a lot of changes to implement this?

The big problem is distinguishing intentional bare-modifier keystrokes from someone just hitting the modifier key immediately prior to another character... for example, we need to distinguish the sequence ctrl-a cmd-p from ctrl ctrl-a cmd cmd-p.

Recognizing the bare modifiers as their own keystroke beyond the first in the sequence creates ambiguity in this regard. It's potentially solvable by matching against both the sequence including bare modifiers and the sequence with the modifiers stripped, but doing so does involve enough changes that I can't take the time to dive in and figure it out right now.

@jnmandal
Copy link

jnmandal commented Oct 6, 2015

+1

I have to context switch between IntelliJ and atom for work and I would love to add 'shift shift' into Atom.

@nunobaba
Copy link

nunobaba commented Oct 7, 2015

@nathansobo Do you have any idea which part of the code is responsible for the keystroke detection? I might have the time to dive into it.

@nathansobo
Copy link
Contributor

@nunobaba This is the line where we prevent handling of bare modifiers. You can follow the logic from there. It's going to take some creativity to allow multi-stroke bare modifier matches without interfering with ordinary matches. We currently just compare strings, for example, here. We could potentially perform a more sophisticated comparison where bare modifiers are selectively ignored.

@agjs
Copy link

agjs commented Dec 5, 2015

  • for this feature, would really make Atom even more amazing or to invent a new word, Amazingier. Hope to see it in the upcoming version.

@harryPL
Copy link

harryPL commented Dec 10, 2015

+1. I use the 'shift shift' in RubyMine all the time and it makes jumping between files really peachy.

@vtambourine
Copy link

Count me it! I am also long to use this WebStorm feature in Atom!

@SavePointSam
Copy link

+1 for implementation. Switch between Webstorm and Atom daily. Would like the single 'shift shit' key command for both. :D

@chrisgorgo
Copy link

+1

@andrewhoff
Copy link

+1 this would be awesome, currently just binding "ctrl-shift" to "project-find:show", then using Esc to get out. Can't use :toggle because the input context doesn't move to the find box, like it does in :show

@mikebronner
Copy link

looking for this as well. :) here's i what i'm using:

'.platform-darwin':
  'ctrl-shift': 'fuzzy-finder:toggle-file-finder

@MikeJKBird
Copy link

+1

2 similar comments
@krissik
Copy link

krissik commented Apr 20, 2016

+1

@xenostar
Copy link

+1

@AndersonJo
Copy link

AndersonJo commented Apr 24, 2016

Please support something like this.. (this one is used in Pycharm)
'.platform-linux':
'shift shift': 'fuzzy-finder:toggle-file-finder'

@AndersonJo
Copy link

+1

1 similar comment
@CCristi
Copy link

CCristi commented May 9, 2016

+1

@overcache
Copy link

+1

1 similar comment
@JBird608
Copy link

+1

@MovingGifts
Copy link

Any progress on this?

@vladshcherbin
Copy link

Oh, come on guys, two years since issue was created. We need this, is it that hard to implement?

@50Wliu
Copy link
Contributor

50Wliu commented May 22, 2016

@vladshcherbin: Yes it is, please see @nathansobo's comment above.

@spurdow
Copy link

spurdow commented Jun 20, 2016

bump +1

@lordblendi
Copy link

bump +1 pls

@coxjc
Copy link

coxjc commented Jul 6, 2016

Begging for this...

@50Wliu
Copy link
Contributor

50Wliu commented Jul 15, 2016

Thanks for the feedback everyone! However, all these +1s and bumps are just adding noise, so to minimize that I'm going to lock this issue for now – we may unlock it once someone starts working on this enhancement to get further feedback.

@atom atom locked and limited conversation to collaborators Jul 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests