Computer Science Canada

Input.KeyDown (chars)

Author:  JSBN [ Fri May 30, 2003 6:50 pm ]
Post subject:  Input.KeyDown (chars)

ok, for net play, i need to send "Input.KeyDown (chars)" over the net. How do i do this whithout using get (ie getch....)?

Thx, mod JSBN

Author:  Asok [ Fri May 30, 2003 7:17 pm ]
Post subject: 

er... Input.KeyDown should replace getch and it doesn't need to be in it's own process as long as it's in the loop.

Author:  Tony [ Fri May 30, 2003 7:46 pm ]
Post subject: 

just send the whole chars array... or go through it and generate a list of characters pressed, then send that if you want to save on some bandwidth (which is a good idea since turing is slow)

Author:  JSBN [ Fri May 30, 2003 8:42 pm ]
Post subject: 

how do i send the chars array ?

Author:  krishon [ Fri May 30, 2003 8:57 pm ]
Post subject: 

i think he means like declare a variable as an array, and then u can call them up when needed. i'm not too shure wut tony means either, lol. this is just a stab

Author:  Homer_simpson [ Fri May 30, 2003 11:00 pm ]
Post subject: 

ok here's a function that works with keydown and returns which character is pressed
code:
var chars : array char of boolean
function inputord (chars : array char of boolean) : int
    for i : chr (1) .. chr (255)
        if chars (i) then
            result ord (i)
        end if
    end for
    result - 1
end inputord
loop
    Input.KeyDown (chars)
    if inputord (chars) not= -1 then
        put inputord (chars)
    end if
end loop


: