============ Key_WriteBindings Writes lines containing "bind key value" ============ */
| 1043 | ============ |
| 1044 | */ |
| 1045 | void 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 | ============ |
no test coverage detected