差分
static void PostKeyWithModifiers(ushort keycode, CGEventFlags modifiers = 0)
{
using (var source = new CGEventSource(CGEventSourceStateID.CombinedSession)) using (var keydown = new CGEvent(source, keycode, keyDown: true)) using (var keyup = new CGEvent(source, keycode, keyDown: false)) { keydown.Flags = modifiers;
}
}