Giter Club home page Giter Club logo

Comments (5)

amibiz avatar amibiz commented on July 29, 2024 1

Support for custom key binding is now available in latest update (v1.9).
Closing issue.

from ergo-keys.

amibiz avatar amibiz commented on July 29, 2024

Thanks @gatoWololo

The list of key bindings are not documented. From the source code

private final ActionBinding[] bindings = {
new ActionBinding("AutoIndentLines", KeyEvent.VK_Q, KeyEvent.VK_QUOTE),
new ActionBinding("EditorDeleteToWordStart", KeyEvent.VK_E, KeyEvent.VK_PERIOD),
new ActionBinding("EditorDeleteToWordEnd", KeyEvent.VK_R, KeyEvent.VK_P),
new ActionBinding("EditorToggleStickySelection", KeyEvent.VK_T, KeyEvent.VK_Y),
new ActionBinding("$Undo", KeyEvent.VK_Y, KeyEvent.VK_F),
new ActionBinding("ErgoKeysGotoAction", KeyEvent.VK_A, KeyEvent.VK_A),
new ActionBinding("EditorEnter", KeyEvent.VK_S, KeyEvent.VK_O),
new ActionBinding("EditorBackSpace", KeyEvent.VK_D, KeyEvent.VK_E),
new ActionBinding("ErgoKeysInsertMode", KeyEvent.VK_F, KeyEvent.VK_U),
new ActionBinding("CommentByLineComment", KeyEvent.VK_Z, KeyEvent.VK_SEMICOLON),
new ActionBinding("EditorCut", KeyEvent.VK_X, KeyEvent.VK_Q),
new ActionBinding("EditorCopy", KeyEvent.VK_C, KeyEvent.VK_J),
new ActionBinding("EditorPaste", KeyEvent.VK_V, KeyEvent.VK_K),
new ActionBinding("EditorLeft", KeyEvent.VK_J, KeyEvent.VK_H),
new ActionBinding("EditorRight", KeyEvent.VK_L, KeyEvent.VK_N),
new ActionBinding("EditorUp", KeyEvent.VK_I, KeyEvent.VK_C),
new ActionBinding("EditorDown", KeyEvent.VK_K, KeyEvent.VK_T),
new ActionBinding("EditorPreviousWord", KeyEvent.VK_U, KeyEvent.VK_G),
new ActionBinding("EditorNextWord", KeyEvent.VK_O, KeyEvent.VK_R),
new ActionBinding("ErgoKeysStartOfLineOrParagraphAction", KeyEvent.VK_H, KeyEvent.VK_D),
new ActionBinding("ErgoKeysEndOfLineOrParagraphAction", KeyEvent.VK_SEMICOLON, KeyEvent.VK_S),
new ActionBinding("NextSplitter", KeyEvent.VK_COMMA, KeyEvent.VK_W),
new ActionBinding("Find", KeyEvent.VK_N, KeyEvent.VK_B),
new ActionBinding("EditorSelectWord", KeyEvent.VK_1, KeyEvent.VK_1),
new ActionBinding("EditorSelectLine", KeyEvent.VK_2, KeyEvent.VK_2),
new ActionBinding("UnsplitAll", KeyEvent.VK_3, KeyEvent.VK_3),
new ActionBinding("SplitVertically", KeyEvent.VK_4, KeyEvent.VK_4),
new ActionBinding("$Delete", KeyEvent.VK_5, KeyEvent.VK_5),
new ActionBinding("EditorSelectLine", KeyEvent.VK_7, KeyEvent.VK_7),
new ActionBinding("EditorSelectWord", KeyEvent.VK_8, KeyEvent.VK_8),
new ActionBinding("ErgoKeysSelectString", KeyEvent.VK_9, KeyEvent.VK_9),
new ActionBinding("ErgoKeysDeleteCurrentCodeBlockAction", KeyEvent.VK_G, KeyEvent.VK_I),
new ActionBinding("EditorToggleCase", KeyEvent.VK_B, KeyEvent.VK_X),
new ActionBinding("HippieCompletion", KeyEvent.VK_OPEN_BRACKET, KeyEvent.VK_SLASH),
new ActionBinding("ErgoKeysActivateInsertModeSpaceBefore", KeyEvent.VK_P, KeyEvent.VK_L),
// Tab shortcuts
new ActionBinding("EditorTab", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
new ActionBinding("NextTemplateVariable", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
new ActionBinding("ExpandLiveTemplateByTab", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
new ActionBinding("NextParameter", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
new ActionBinding("BraceOrQuoteOut", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
new ActionBinding("EditorIndentSelection", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
new ActionBinding("EditorChooseLookupItemReplace", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
new ActionBinding("EditorChooseLookupItem", KeyEvent.VK_TAB, KeyEvent.VK_TAB),
// Enter shortcuts
new ActionBinding("EditorEnter", KeyEvent.VK_ENTER, KeyEvent.VK_ENTER),
new ActionBinding("EditorChooseLookupItem", KeyEvent.VK_ENTER, KeyEvent.VK_ENTER),
// Misc. shortcuts
new ActionBinding("EditorEscape", KeyEvent.VK_ESCAPE, KeyEvent.VK_ESCAPE),
new ActionBinding("EditorBackSpace", KeyEvent.VK_BACK_SPACE, KeyEvent.VK_BACK_SPACE),
// Navigation
new ActionBinding("GotoDeclaration", KeyEvent.VK_SLASH, KeyEvent.VK_Z),
// Unused keys
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_BACK_QUOTE, KeyEvent.VK_BACK_QUOTE),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_6, KeyEvent.VK_6),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_0, KeyEvent.VK_0),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_MINUS, KeyEvent.VK_OPEN_BRACKET),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_EQUALS, KeyEvent.VK_CLOSE_BRACKET),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_W, KeyEvent.VK_COMMA),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_CLOSE_BRACKET, KeyEvent.VK_EQUALS),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_BACK_SLASH, KeyEvent.VK_BACK_SLASH),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_QUOTE, KeyEvent.VK_MINUS),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_M, KeyEvent.VK_M),
new ActionBinding("ErgoKeysNoopAction", KeyEvent.VK_PERIOD, KeyEvent.VK_V),
};
private final ActionBinding[] leaderBindings = {
new ActionBinding("Back", KeyEvent.VK_J, KeyEvent.VK_H),
new ActionBinding("Forward", KeyEvent.VK_L, KeyEvent.VK_N),
new ActionBinding("GotoImplementation", KeyEvent.VK_SLASH, KeyEvent.VK_Z),
new ActionBinding("ErgoKeysFindInPathAction", KeyEvent.VK_N, KeyEvent.VK_B),
new ActionBinding("Switcher", KeyEvent.VK_COMMA, KeyEvent.VK_W),
new ActionBinding("FileStructurePopup", KeyEvent.VK_P, KeyEvent.VK_L),
new ActionBinding("EditorTextStart", KeyEvent.VK_H, KeyEvent.VK_D),
new ActionBinding("EditorTextEnd", KeyEvent.VK_SEMICOLON, KeyEvent.VK_S),
new ActionBinding("VcsShowPrevChangeMarker", KeyEvent.VK_U, KeyEvent.VK_G),
new ActionBinding("VcsShowNextChangeMarker", KeyEvent.VK_O, KeyEvent.VK_R),
new ActionBinding("SelectNextOccurrence", KeyEvent.VK_8, KeyEvent.VK_8),
new ActionBinding("ShowIntentionActions", KeyEvent.VK_ENTER, KeyEvent.VK_ENTER),
};

The first key code is for QWERTY and the second for Dvorak. Also note the leader key bindings for an extra layer of commands. Currently, the leader key is mapped to the space key. For example, SPACE + J and SPACE + L will navigate the editor back and forward respectively.

Regarding changes to the key bindings, it is hard coded.

I have opened two issues to address the above:

  • #3 Document all supported key bindings
  • #4 Support custom key bindings

from ergo-keys.

amibiz avatar amibiz commented on July 29, 2024

@gatoWololo FYI, all supported key bindings are now documented in the README (ref #5)

from ergo-keys.

gatoWololo avatar gatoWololo commented on July 29, 2024

This is great. Thank you!

from ergo-keys.

amibiz avatar amibiz commented on July 29, 2024

@gatoWololo @amynbe

PR #16 introduces support for custom CMD mode key bindings. You can now select the CMD mode keymap using the settings dialog File -> Settings -> Keymap and modify shortcuts. Also, default shortcuts are merged into CMD mode keymap (e.g. Ctrl + B and Ctrl + Button1 Click for GotoDeclaration).

from ergo-keys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.