Dynamically allocate key buffer for Visual Studio