|
Newbie Question--Inputing Data |
Matt Ward
Member #8,046
November 2006
|
Hi there, |
spork222
Member #7,263
May 2006
|
You'd have to use either key[KEY_whatever] or readkey() (most likely readkey) to obtain user input key by key then take that data and use it for something. Sorry I can't help more than that; I haven't actually done this myself, just how to do it.:'( |
Matt Ward
Member #8,046
November 2006
|
Thanks for your help spork. Another thought, in my college C++ class, we learned to import data from other programs using #include <fstream>. Although that doesn't work, is there away for Allegro to access data from other programs? Thanks Again! |
LennyLen
Member #5,313
December 2004
|
Quote: If I wanted to type a number like 1.34 (or any other double), wouldn't it just accept the first key pressed? Is there a way to tie multiple "pressings"? Read the input key by key and save it in a buffer. Then when the user has hit ENTER (or whtever you want to use to terminate input), convert the contents of the buffer to a numeric format.
|
miran
Member #2,407
June 2002
|
Or use the Allegro GUI routines, most notably d_edit_proc() -- |
TeamTerradactyl
Member #7,733
September 2006
|
Matt Ward said: ...import data from other programs using #include <fstream>. Although that doesn't work...
|
Dorianin
Member #8,013
November 2006
|
i had a couple of functions that did exactly what your talking about.... ...but i just spent 15 minutes looking through my dev files and i think it may be deleted.(check,oh gods, check before delete!)... someone here should know it, since i got it from the code gallery, although the link seems to be broken... ..there was a couple of lines of hexidecimal magic, to take the actual ascii value of the keypress and put it into a string, inside a loop that went till enter. ...try the code gallery, theres only 3 files there...you should recognize the one...:) never play leapfrog with a unicorn.... |
Three Harris
Member #6,226
September 2005
|
I am not sure but I think this is the snipit you want.
|
Neil Walker
Member #210
April 2000
|
Why code when the allegro wiki is there for you http://awiki.tomasu.org/bin/view/Main/TextInputC there's a c++ version as well. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Three Harris
Member #6,226
September 2005
|
Quote: Why code That is basicly identical code. [edit] But I didn't have that link so thanks. |
|