=================== idKeyInput::SetBinding =================== */
| 472 | =================== |
| 473 | */ |
| 474 | void idKeyInput::SetBinding( int keynum, const char *binding ) { |
| 475 | if ( keynum == -1 ) { |
| 476 | return; |
| 477 | } |
| 478 | |
| 479 | // Clear out all button states so we aren't stuck forever thinking this key is held down |
| 480 | usercmdGen->Clear(); |
| 481 | |
| 482 | // allocate memory for new binding |
| 483 | keys[keynum].binding = binding; |
| 484 | |
| 485 | // find the action for the async command generation |
| 486 | keys[keynum].usercmdAction = usercmdGen->CommandStringUsercmdData( binding ); |
| 487 | |
| 488 | // consider this like modifying an archived cvar, so the |
| 489 | // file write will be triggered at the next oportunity |
| 490 | cvarSystem->SetModifiedFlags( CVAR_ARCHIVE ); |
| 491 | } |
| 492 | |
| 493 | |
| 494 | /* |
nothing calls this directly
no test coverage detected