I found a very good approach, but there is still a problem. look at the code, then I will write what the current problem is.
CGEventRef downEvt = CGEventCreateKeyboardEvent( NULL, 0, true );
CGEventRef upEvt = CGEventCreateKeyboardEvent( NULL, 0, false );
UniChar oneChar = 'h';
CGEventKeyboardSetUnicodeString( downEvt, 1, &oneChar );
CGEventKeyboardSetUnicodeString( upEvt, 1, &oneChar );
CGEventPost( kCGAnnotatedSessionEventTap, downEvt );
CGEventPost( kCGAnnotatedSessionEventTap, upEvt );
, , , , kCGAnnotatedSessionEventTap, kCGSessionEventTap, Box. , .
,