Add double-shift behavior

Created by lee-dohm
Last updated about 1 year ago
keyPressed = false;

atom.keymaps.addKeystrokeResolver ({event}) ->
  if event.key == "Shift" && event.type == "keydown"
    if keyPressed
      keyPressed = false;
      console.log('keyPressed');
      return 'shift-double';
    else
      keyPressed = true;
      setTimeout (-> keyPressed = false), 200;
      return null;

Adding this to your init.coffee should allow you to use shift-double in keymaps to execute commands by double-tapping either shift key.

Credit goes to @spaceribs for the code: https://gist.github.com/spaceribs/76b62d6cedb1d0892ec10a8b35d38683