MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / SetBinding

Method SetBinding

neo/framework/KeyInput.cpp:474–491  ·  view source on GitHub ↗

=================== idKeyInput::SetBinding =================== */

Source from the content-addressed store, hash-verified

472===================
473*/
474void 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/*

Callers

nothing calls this directly

Calls 3

SetModifiedFlagsMethod · 0.80
ClearMethod · 0.45

Tested by

no test coverage detected