You need to tell AngelScript:
"bool IsKeyDown(const string ∈)" to tell AngelScript to pass the string as a constant reference (for use as input)
You need to have the C++ function as:
bool TInput::IsKeyDown(const asCScriptStruct *str)
or
bool TInput::IsKeyDown(const asCScriptStruct &str)
because asCScriptStruct is the [default, unless you wrote your own] way AngelScript passes strings back to C++. It's const, because you registered the function with AngelScript as const -- and of course it's a reference/pointer.
I DO know you registered the original IsKeyDown with AngelScript wrong (you said "string key" instead of "string ∈" or "const string ∈". You never posted what you were using for the C++ of IsKeyDown, so I took a guess that you had that wrong, which caused the compiler to handle the arguments being passed to the function (from AngelScript) wrong -- which caused the stack problems.