Hi Philip, That is absolutely true. The getchar function is about as basic and standard as one can possibly get, and I am beginning to think it might be the best solution for the problem. I have done some research on writing custom getch functions and like you said they tend to be platform specific or behave differently from system to system. So a pseudo getch hack probably won't work.
Regarding SDL I was unaware SDL 2.0 had been released but that is nice to know. Especially, since I just spent two years of my life writing my game engine with SDL 1.2 support, and now am aware SDL 2.0 is out and I need to update the engine. I see from information on the SDL website there are some cool advantages to updating to SDL 2 such as force feedback support for joysticks, a new audio wrapper for XAudio2, added support for XInput, and a bunch of other goodies. So thanks for the tip. However, to answer your immediate question I was under the impression the only way I could initialize keyboard support in SDL was if I created a window and assigned keyboard events to it. I wasn't aware you could poll keyboard events using SDL in a console window. I was pretty certain I had to initialize a window which is why I hadn't considered SDL for this console project. It would be nice if I I can use he keyboard in SDL without initializing the video components and draw a graphical window as that would make my life a whole lot easier. Cheers! On 4/16/14, Philip Bennefall <phi...@blastbay.com> wrote: > Hi Thomas, > > getchar is, as you know, about as basic as you can get but at least it is > standardized. getch is not, nor would a custom pseudo getch hack be. It's > bound to exhibit different behavior on various platforms and you'd have to > have access to all of them to verify. If you want immediate reactions > without the need to wait for a return keypress, have you considered using > something basic such as the keyboard handling in SDL in your console window? > > Then you can suddenly treat the keyboard in a similar fashion to what you > would do in a regular non-console game, but do it portably. SDL has received > > a major rewrite in version 2.0 and is now under the Zlib/Libpng license > which is very commercial friendly. > > Kind regards, > > Philip Bennefall --- Gamers mailing list __ Gamers@audyssey.org If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org. You can make changes or update your subscription via the web, at http://audyssey.org/mailman/listinfo/gamers_audyssey.org. All messages are archived and can be searched and read at http://www.mail-archive.com/gamers@audyssey.org. If you have any questions or concerns regarding the management of the list, please send E-mail to gamers-ow...@audyssey.org.