Well, after looking at it for some time, the answer is this: you cannot define this without relying on legacy APIs or textareahack.
Of course, they are unlikely to ever disappear, but if someone finishes searching for a way to do this without them, they will not find it.
key, , - , .