Shortcut mode starting with ESC

I am looking for a general idea of how to go about implementing a shortcut mode where you press ESC and then another key to trigger a function. I currently see that ESC is used as a trigger to switch between indent and focus change.

I assume that would be a custom extension but not sure how to go about what ESC is currently already doing. My though process is once ESC is pressed disable the editor and listen for the next key to perform the shortcut.

Any pointers would be greatly appreciated.

You can use multi-stroke key bindings for something like this, but I don’t recommend using escape for this purpose because, indeed, it’ll mess with the tab handling.