You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow users to double tap any button (eg. as IDEA allows it with their "double shift")
something like this
'.platform-win32':'shift-shift':'fuzzy-finder:toggle-file-finder'# or plus'.platform-win32':'shift+shift':'fuzzy-finder:toggle-file-finder'
What benefits does this feature provide?
No big deal. I would just love to see this feature because of the muscle memory gained in IDEA, hard to not double press shift and somehow I believe some idea users might not like any ide if its not possible to configure double tap.
Any alternatives?
Edit File > Init Script (init.js):
constkeystrokeCache={};constmaxDoubleTime=500;constallowKeystrokeResolverOnlyFor=['shift'/*, 'enter'*/];atom.keymaps.addKeystrokeResolver((keypress)=>{try{constkeystroke=keypress.keystroke;if(allowKeystrokeResolverOnlyFor.indexOf(keystroke)>=0){// keypress.event.repeat == is holding, doesnt countif(!keypress.event.repeat&&keypress.event.type=='keydown'){constlastPressedTimestamp=keystrokeCache[keystroke]||keypress.event.timeStamp;constcurrentPressedTimestamp=keypress.event.timeStamp;constdiff=currentPressedTimestamp-lastPressedTimestamp;if(diff>0&&diff<maxDoubleTime){return`${keystroke}+${keystroke}`;}keystrokeCache[keystroke]=keypress.event.timeStamp;}}}catch(e){console.error('DoubleKeystrokeResolver: ',e);}});
Use in File > Keymap (keymap.cson) for example:
# Use + instead of -'.platform-win32':'shift+shift':'fuzzy-finder:toggle-file-finder'
hint. Check allowKeystrokeResolverOnlyFor to allow any other buttons than shift for double tap (be caution with buttons like backspace)
hint. You need to use + instead of - in keymap.cson because - doesn't work for double tap (it seems that pulsar-edit is interpreting shift-shift like a single button press).
Other examples:
No response
The text was updated successfully, but these errors were encountered:
Thanks for the contribution, this would be a pretty cool feature to see integrated
Check "Alternatives": I wrote a script which you could add to your own init.js, its a bit hacky and it could be done better (eg. if your init.js gets bigger such "little scripts" end up messy or you could increase the performance by using keyid instead of strings etc.) but it does what its supposed to do.
I don't think this is supported by Electron or browsers in general (trigger an event when a modifier key is pressed). If they don't send us the keystroke, there's nothing we can actually do...
One thing they you CAN do already is double tap any key that's not a modifier. For example, the keystroke 'esc esc' works today (double tap escape key).
Have you checked for existing feature requests?
Summary
Allow users to double tap any button (eg. as IDEA allows it with their "double shift")
something like this
What benefits does this feature provide?
No big deal. I would just love to see this feature because of the muscle memory gained in IDEA, hard to not double press shift and somehow I believe some idea users might not like any ide if its not possible to configure double tap.
Any alternatives?
Edit
File > Init Script (init.js)
:Use in
File > Keymap (keymap.cson)
for example:hint. Check
allowKeystrokeResolverOnlyFor
to allow any other buttons thanshift
for double tap (be caution with buttons likebackspace
)hint. You need to use
+
instead of-
inkeymap.cson
because-
doesn't work for double tap (it seems that pulsar-edit is interpretingshift-shift
like a single button press).Other examples:
No response
The text was updated successfully, but these errors were encountered: