We could bind keystrokes to commands via CSS custom properties associated with selectors. We currently do this anyway on a conceptual level but are forced to match selectors manually. Using custom properties might make it faster to match bindings and would probably make troubleshooting bindings much easier due to dev-tools support.
If anyone that's seriously interested in trying this please let me know and I can provide guidance. This relies on upgrading Atom to Electron 0.37.0 which is incomplete at the time of this writing, but will certainly happen. You can test this library in isolation to experiment with the idea.
Example:
body {
--atom-binding--ctrl-x_ctrl-s: 'core:save'
}
Then in JS we could just read the computed style when dispatching keyboard events instead of matching selectors.
We could bind keystrokes to commands via CSS custom properties associated with selectors. We currently do this anyway on a conceptual level but are forced to match selectors manually. Using custom properties might make it faster to match bindings and would probably make troubleshooting bindings much easier due to dev-tools support.
If anyone that's seriously interested in trying this please let me know and I can provide guidance. This relies on upgrading Atom to Electron 0.37.0 which is incomplete at the time of this writing, but will certainly happen. You can test this library in isolation to experiment with the idea.
Example:
Then in JS we could just read the computed style when dispatching keyboard events instead of matching selectors.