Ctrl + z not working while with type: fields

I know is because the {{type:fields}} are text boxes that catch the ctrl + z combo. I just use it a lot and is very annoying

Is there a secondary combo i can use or maybe make ctrl z bypass the text box, since its usually useless in that context? maybe make alt z work as well?

Possible workaround:

You could use the add-on Customize Keyboard Shortcuts and set m_toolbox_undo to some other shortcut (like Alt + Z, if that is available, but perhaps there are more ergonomic options).

Drawback: you would need to adjust to a new combo, but the advantage is that it should then be usable on all notes.

Edit: Actually, you might be able to assign a secondary command for the undo-action:

“Support for duplicated shortcuts on the reviewer window is available.”
– the author from the add-on page on AnkiWeb

What exactly is not working? When I have a type field focused, Ctrl+Z reverts the type actions, but once there is none left (the field is empty again), the event is propagated and the last review or whatever is undone.
Alternatively, it’s alwys possible to Tab out of the field before pressing Ctrl+Z.

@kleinerpirat thanks! customize keyboard shortcuts is probably going to fix this for me. Its a shame is not fixed by default tho

@Rumo That would be amazing, but doesnt work for me. I have to tab before ctrl + z. Annoying thing is that i only type in one direction, so sometimes i have to tab, and some times i dont have to. Is it a bug then?

Not sure I understand. Of course, you only need to tab if your cursor is inside a type field which would catch the shortcut.

You said ctrl z reverse the type actions, and when none is left, the event is propagated and goes to the last review. This does not work for me. If there is a type field, it auto focus on it and ctrl z doesnt undo the review for me

I know about tab before ctrl z to leave the type field. I just considered it annoying because only half of my cards have type field (only type field is in one direction, one card per note)

That means that if i want to quickly undo my review, i have to first check my current cart to see if i have to tab or not. Which is very annoying if you undo reviews often (which i do)

So the question “Is it a bug then?” was referring to undoing inside the field then? I have no idea to be honest. Could be an OS thing. I’m on Windows and I tested it on the latest Anki release.

It seems like a bug indeed. Im on linux and it doesnt propagate

Im never sure if you have to open a bug in github or the thread in the forum is enough

Usually, the forum is the right place. However in this case, my guess is that it can’t be fixed in Anki, anyway.

Why wouldnt it be possible to be fixed?

I think Rumo meant that it is most likely caused by the web toolkit used by Anki, not Anki itself. Fixing it might not be trivial, since third-party functions would have to be reimplemented.


A similar case would be the insertion of non-breaking spaces by the web toolkit:

1 Like

@kleinerpirat i see

But if it works on some platforms, the bug could be raised in the appropriate tool kit if its not directly implemented on anki

Anyway, the addon worked in an unexpected way. After assigning m_toolbox undo": "Alt+Z", ctrl + z worked in the windows again. Since i dont ever need to undo in the type box, i dont have to actually use alt + z. So its just like i disabled the ctrl z in the type field

If it can be fixed with an addon, it could also be fixed in anki directly, isnt it? :slight_smile: