INJECTED
is to allow plugins to ignore key events, so they won’t end up in an endless loop (like SpaceCadet
trying to turn a shift into a paren over and over and over again). It is not redundant with UNKNOWN_KEYSWITCH_LOCATION
, because plenty of INJECTED
keys retain the coordinates of the originating key (like SpaceCadet
). Whenever the cost of storing the original location is cheap (or zero) we tried to preserve the coordinates. We only use UNKNOWN_KEYSWITCH_LOCATION
when the original position is not available, usually because it would be too complex, or too big to store. For example, for one-shot keys, we’d have to store the position of all active oneshots, and that’d be costy. With SpaceCadet
, we do everything in a single event handler, which gets the coordinates as arguments anyway, so the cost is zero.