KeyValues < Handle

Last Updated2026-07-23
Created At2014-11-08

Methods39
SymbolDescription
DeleteKeyRemoves the given key from the current position.
DeleteThisRemoves the current sub-key and attempts to set the position to the sub-key after the removed one. If no such sub-key exists, the position will be the parent key in the traversal stack. Given the sub-key having position "N" in the traversal stack, the removal will always take place from position "N-1."
ExportToFileExports a KeyValues tree to a file. The tree is dumped from the current position.
ExportToStringExports a KeyValues tree to a string. The string is dumped from the current position.
FindKeyByIdFinds a KeyValues name by id.
FromAddressWraps an existing native KeyValues pointer in a KeyValues Handle, for example one obtained from the game through an SDKCall or a detour. The returned Handle does NOT own the underlying KeyValues: closing or deleting it will not free the pointed-to memory (which is owned by whoever created it, typically the game). The Handle must not be used after the underlying KeyValues has been freed.
GetColorRetrieves a set of color values from a KeyValues key.
GetColor4Retrieves a set of color values from a KeyValues key.
GetDataTypeReturns the data type at a key.
GetFloatRetrieves a floating point value from a KeyValues key.
GetNameSymbolFinds a KeyValues id inside a KeyValues tree.
GetNumRetrieves an integer value from a KeyValues key.
GetSectionNameRetrieves the current section name.
GetSectionSymbolRetrieves the current section id.
GetStringRetrieves a string value from a KeyValues key.
GetUInt64Retrieves a large integer value from a KeyValues key.
GetVectorRetrieves a vector value from a KeyValues key.
GoBackJumps back to the previous position. Returns false if there are no previous positions (i.e., at the root node with an empty traversal stack). This should be called once for each successful Jump call, in order to return to the top node. This function pops one node off the internal traversal stack.
GotoFirstSubKeySets the current position in the KeyValues tree to the first sub key. This native adds to the internal traversal stack.
GotoNextKeySets the current position in the KeyValues tree to the next sub key. This native does NOT add to the internal traversal stack, and thus GoBack() is not needed for each successive call to this function.
ImportImports subkeys in the given KeyValues, at the current position in that KeyValues, into the current position in this KeyValues. Note that this copies keys; it does not embed a reference to them.
ImportFromFileImports a file in KeyValues format. The file is read into the current position of the tree.
ImportFromStringConverts a given string to a KeyValues tree. The string is read into the current postion of the tree.
JumpToKeySets the current position in the KeyValues tree to the given key.
JumpToKeySymbolSets the current position in the KeyValues tree to the given key.
KeyValuesCreates a new KeyValues structure. The Handle must be closed with CloseHandle() or delete.
MergeMerge from the current position of another KeyValues into the current position of this one.
NodesInStackReturns the position in the jump stack; I.e. the number of calls required for KvGoBack to return to the root node. If at the root node, and the traversal stack is empty, 0 is returned.
RewindSets the position back to the top node and clears the entire node traversal history (by default). This can be used instead of looping KvGoBack() if recursive iteration is not important.
SavePositionSaves the current position in the traversal stack onto the traversal stack. This can be useful if you wish to use KvGotoNextKey() and have the previous key saved for backwards traversal.
SetColorSets a set of color values of a KeyValues key.
SetColor4Sets a set of color values of a KeyValues key.
SetEscapeSequencesSets whether or not the KeyValues parser will read escape sequences. For example, \n would be read as a literal newline. This defaults to false for new KeyValues structures.
SetFloatSets a floating point value of a KeyValues key.
SetNumSets an integer value of a KeyValues key.
SetSectionNameSets the current section name.
SetStringSets a string value of a KeyValues key.
SetUInt64Sets a large integer value of a KeyValues key.
SetVectorSets a vector value of a KeyValues key.
Properties1
SymbolTypeDescription
ExportLengthintAmount of bytes written by ExportToFile & ExportToString.