Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Input.KeyDown (chars)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JSBN




PostPosted: 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
Sponsor
sponsor
Asok




PostPosted: 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




PostPosted: 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)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
JSBN




PostPosted: Fri May 30, 2003 8:42 pm   Post subject: (No subject)

how do i send the chars array ?
krishon




PostPosted: 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




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: