tidalcycles / strudel

Web-based environment for live coding algorithmic patterns, incorporating a faithful port of TidalCycles to JavaScript
https://strudel.cc/
GNU Affero General Public License v3.0
579 stars 105 forks source link

export comment commands #1136

Closed felixroos closed 3 days ago

felixroos commented 4 days ago

exports potentially helpful codemirror commands to the global scope:

this allows writing custom keybindings, for example:

window.keyhandler && document.removeEventListener('keypress',window.keyhandler)
window.keyhandler = (e) => {
  e.key === '7' && e.ctrlKey && toggleComment(strudelMirror.editor)
}
document.addEventListener('keypress', window.keyhandler)
felixroos commented 4 days ago

workaround for https://github.com/tidalcycles/strudel/issues/901