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

Function Key_KeynumToString

code/client/cl_keys.cpp:904–922  ·  view source on GitHub ↗

=================== Key_KeynumToString Returns a string (either a single ascii char, a K_* name, or a 0x11 hex string) for the given keynum. =================== */ Returns a console/config file friendly name for the key

Source from the content-addressed store, hash-verified

902*/
903// Returns a console/config file friendly name for the key
904const char *Key_KeynumToString( int keynum ) {
905 const char *name;
906
907 name = Key_KeynumValid( keynum );
908
909 // Check for friendly name
910 if ( !name )
911 name = Key_KeyToName( keynum );
912
913 // check for printable ascii
914 if ( !name && keynum > 0 && keynum < 256)
915 name = Key_KeyToAscii( keynum );
916
917 // Fallback to hex number
918 if ( !name )
919 name = Key_KeyToHex( keynum );
920
921 return name;
922}
923
924/*
925===================

Callers 5

Key_KeynumToStringBufFunction · 0.70
Key_Bind_fFunction · 0.70
Key_WriteBindingsFunction · 0.70
Key_Bindlist_fFunction · 0.70
IN_PrintKeyFunction · 0.50

Calls 4

Key_KeynumValidFunction · 0.70
Key_KeyToNameFunction · 0.70
Key_KeyToAsciiFunction · 0.70
Key_KeyToHexFunction · 0.70

Tested by

no test coverage detected