MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Field_Paste

Function Field_Paste

code/client/cl_keys.cpp:487–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485*/
486void Field_CharEvent( field_t *edit, int ch );
487void Field_Paste( field_t *edit ) {
488 char *cbd, *c;
489
490 c = cbd = Sys_GetClipboardData();
491
492 if ( !cbd ) {
493 return;
494 }
495
496 // send as if typed, so insert / overstrike works properly
497 while( *c )
498 {
499 uint32_t utf32 = ConvertUTF8ToUTF32( c, &c );
500 Field_CharEvent( edit, ConvertUTF32ToExpectedCharset( utf32 ) );
501 }
502
503 Z_Free( cbd );
504}
505
506/*
507=================

Callers 2

Field_KeyDownEventFunction · 0.70
Field_CharEventFunction · 0.70

Calls 5

Sys_GetClipboardDataFunction · 0.85
Field_CharEventFunction · 0.70
ConvertUTF8ToUTF32Function · 0.50
Z_FreeFunction · 0.50

Tested by

no test coverage detected