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

Function Key_WriteBindings

code/client/cl_keys.cpp:1045–1058  ·  view source on GitHub ↗

============ Key_WriteBindings Writes lines containing "bind key value" ============ */

Source from the content-addressed store, hash-verified

1043============
1044*/
1045void Key_WriteBindings( fileHandle_t f ) {
1046 FS_Printf( f, "unbindall\n" );
1047 for ( size_t i=0; i<MAX_KEYS; i++ ) {
1048 if ( kg.keys[i].binding && kg.keys[i].binding[0] ) {
1049 const char *name = Key_KeynumToString( i );
1050
1051 // handle the escape character nicely
1052 if ( !strcmp( name, "\\" ) )
1053 FS_Printf( f, "bind \"\\\" \"%s\"\n", kg.keys[i].binding );
1054 else
1055 FS_Printf( f, "bind \"%s\" \"%s\"\n", name, kg.keys[i].binding );
1056 }
1057 }
1058}
1059
1060/*
1061============

Callers 1

Com_WriteConfigToFileFunction · 0.50

Calls 2

Key_KeynumToStringFunction · 0.70
FS_PrintfFunction · 0.50

Tested by

no test coverage detected