Are you trying to do this in bash? |
No, I'm trying to do this in a console program (the code I posted above)
Are you trying to implement the equivalent of the history command in your code or not? |
I posted the bash example (it's completely unrelated to the problem), because it has the exact functionality I need, only for C++.
Also when I press the up arrow in bash as I am running the program, I do not get the previous things I have typed before |
No, bash is completely unrelated, you get your previous results if you press the up arrow
(↑) or the right arrow
in the program (same code as in the first post)
Apparently the
SetConsoleHistoryInfo
is only for Windows Vista and above (I'm on Linux and I use a Windows XP VM to build Windows specific programs), so I'm looking for
something that is compatible with Windows XP and Windows 7 |
(and, if possible, Linux, (I do realise Windows an Linux are so different it's probably impossible).
The thing is that in a larger console game, once the player types his/her name it starts appearing in various locations if the player presses the up arrow.
Maybe I could use
GetAsyncKeyState
to create an exception, that if the up arrow is pressed the program ignores it?