(No Subject)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Sorry,
I was wrong about ASCII 14 deleting a character in DOS32, my memory was of by 1
 and
off the track. ASCII 13 [ puts(1,13) ]  goes back to the begining of the line in
DOS32. I was trying to display the notes ASCII 14 then ASCII 13, on a new line,
 so
it looked like it was deleting, that's why I thought you could. Sorry Again.
 Where
I got 12 from is any bodies
guess.

If you want to task your program, I have an idea...

----snip----

--<untested code>
function get_input()
sequence keys, pos
integer key

        keys = {}
        while 1 do
                key = get_key()
                if key = -1 then
                        exit
                elsif key >= 32 and
                         key <= 255 then
                                puts(1,key)
                --elsif key = 10 or key = 13 then
                        --puts(1,key)
                        --In a game you may not
                        --want it to \n
                elsif key = 8 then
                        pos = get_position()
                        position(pos[1],pos[2]-1)
                        puts(1,0)
                        position(pos[1],pos[2]-1)
                end if
                keys = keys & key
        end if
        return keys
end function

-----end snip-----
This returns a list of all keys pressed.
You can then step through it to find special keys, etc and add the rest to your
 string.

Now if there is no keys in the buffer it doesn't waste time.
Wipes keys on screen.
Disadvantage: If you chew up CPU time doing other ops then you will probablely
find keys being 'missed', dropped out of the buffer before being read.

If your using WIN32, consider writing two apps to run at the same time, one
 invisible
one to control the world, and one to deal with the user and use DDE &/ shared
 memory,
a lot more complex. Remember to close the invisible one.

---
Sincerely,
Mathew Hounsell
Mat.Hounsell at mailexcite.com




Free web-based email, Forever, From anywhere!
http://www.mailexcite.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu