Fix input callbacks to be per-context.