Console..
Hi - I''m quickly developing a simple command line interpreter for my game engine, and all the internal string manipulation and rendering are working fine. However, I need somehow to read the keyboard for whenever a key is pressed and then strcat this to the console''s input buffer. How would I do this quickly with DirectInput? I.E. wait for user input and then quickly retrieve the char from it?
Thanx
r.
What you want to do is while you''re using your command line thingie, switch DirectInput to buffered mode. That way you don''t have to store the buffer on your own, and don''t have to check each key to see if it''s down.
Unfortunately, I can''t recall how to do it at the moment, but it''s pretty simple.
Jonathan
Unfortunately, I can''t recall how to do it at the moment, but it''s pretty simple.
Jonathan
If you''re interested, I have a buffered input sample on my web site (well, it''s a program that uses buffered input). It''s at www.crosswinds.net/~uselessknowledge. It''s the "Keybaord Monitor" on the other page.
you could also just use the win32 input stuff, you really don''t need high performance input for typing in text and you''ll be able to take advantage of things like repeating characters when a key is held down.
+AA_970+
+AA_970+
Yeh thanx - that''s got that working. Now for a really stupid question; how do I convert ascii codes into chars and vice versa in MSVC?
I''ve looked but haven''t found.
I''ve looked but haven''t found.
May 23, 2000 03:23 PM
chars are just ascii values. if you have an int with an ascii code, just do c = (char) i; or whatever. Don''t you mean direct input''s keyboard constants though? like DIK_1 etc?
Frank
Frank
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement