Some keyboard shortcuts doesn't work in custom editor window

I’m working on a custom editor window. I’d like to have some keyboard shortcuts in there. Some shortcuts doesn’t seem to work however, such as ctrl+A when event keycode is KeyDown (works with KeyUp), or ctrl+S regardless of KeyDown or KeyUp (triggers the Save Scene dialog).

I assume this is because those shortcuts are somehow “hardwired” to specific Unity methods?

Anyway, can I get it to work somehow? If they are “hardwired” to Unity methods it would be nice to be able to override that, in a sense telling Unity that “Hey, I know what I’m doing and the user expects ctrl+S do something else than saving the scene right here, right now.”.

I have tried, and it doesn’t seem like this is possible.

I’m pretty sure that Unity calls .Use on the ctrl+s event internally, and that happens before the event gets passed to scripts. The even should probably be passed through the user scripts before it’s handled by Unity, but that’s not how things work.

Since ctrl is bound to so many things, it’s often convenient to use alt for shortcuts you define for your own projects. Nothing is like downloading some nice asset package from the store, and finding that a bunch of your own shortcuts now conflict with shortcuts from that package.

Conflicting shortcuts sounds inevitable as long as they are “Unity wide” and not bound to the currently focused editor window. I can see why having shortcuts be “Unity wide” is a good thing since it would suck to have to switch window focus just to get some shortcut to work. At the same time, it can be a pita. I’ll have to work something clever out I guess.