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
I would like the ability to set custom keybindings for the application. Currently, the code responsible for handling keybindings is as follows:
document.addEventListener('keyup',function(e){// alt + Z or zif((e.keyCode==90||e.keyCode==122)&&e.altKey){e.preventDefault();ts_undo();}// /if(e.key==="."){clear_canvas();}// ,if(e.key===","){switch_visibility();}// alt + C or cif((e.key==="c"||e.key==="C")&&e.altKey){e.preventDefault();switch_drawing_mode();}// alt + X or xif((e.key==="x"||e.key==="X")&&e.altKey){e.preventDefault();switch_perfect_freehand();}if((e.key==="b"||e.key==="B")&&e.altKey){e.preventDefault();switch_small_canvas();}})
I am not very experienced in JavaScript, but would it be possible to modify this to allow custom keybindings?
The text was updated successfully, but these errors were encountered:
Hi, sorry for the late response. I am not planning to add a ui for keybinding configuration, but you have found the correct place in the code to change the keybindings. You can find the file you need to edit by going through these menus: Tools->Add-Ons->Select Ankidraw in the addons window->Press the View Files button.
This will then bring you to the folder containing the init.py file, which contains this same code you found and by editing it, then restarting Anki will load the addon with your changes. Doing this you can edit the keybinding to what works better for you.
I would like the ability to set custom keybindings for the application. Currently, the code responsible for handling keybindings is as follows:
I am not very experienced in JavaScript, but would it be possible to modify this to allow custom keybindings?
The text was updated successfully, but these errors were encountered: