Author |
Message |
JSBN

|
Posted: 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 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Asok

|
Posted: Fri May 30, 2003 7:17 pm Post subject: (No 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. |
|
|
|
|
 |
Tony

|
Posted: Fri May 30, 2003 7:46 pm Post subject: (No 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) |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
JSBN

|
Posted: Fri May 30, 2003 8:42 pm Post subject: (No subject) |
|
|
how do i send the chars array ? |
|
|
|
|
 |
krishon
|
Posted: Fri May 30, 2003 8:57 pm Post subject: (No 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 |
|
|
|
|
 |
Homer_simpson

|
Posted: Fri May 30, 2003 11:00 pm Post subject: (No 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
|
|
|
|
|
|
 |
|