#how to send keyboard inputs over tcp?

1 messages · Page 1 of 1 (latest)

fair pivot
#

a while ago, i played around a bit boost to make a small async tcp server bc i wanted to try out boost.

for my uni i had to create a game in rust. as the final project (we can do anything we want), i want to try adding multiplayer to it.

i already have a way of sending data to my rust client and back.

i am just not sure how to send key info (up, left, down, right) over the network? when i press my left arrow, it says "^[[C" but does not send the message until i press enter....i could clear that string and send it to the rust client to do something in the game...(but i am not sure if every operating system etc sends "^[[C" if i press left arrow)

any ideas?

outer hazelBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@fair pivot

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

fair pivot
#

i want to try sending keyboard inputs but idk how...

#

i was like "oh i can use c++ for this" but i dont know if that works 🙁

lofty fox
#

It depends on your enviroment if you are using linux AFAIK

#

I think there's no general way to do that

fair pivot
#

i donthow need to disable buffering of the terminal on the client side

#

but i dont know if thats possible

lofty fox
#

I'

#

I'm not sure haven't done that

fair pivot
#

thanks either way

outer hazelBOT
#

@fair pivot Has your question been resolved? If so, type !solved :)

dry cedar
#

Why dont you send instructions/commands instead of key events?
But idk i havent seen your code or implmentations

quartz charm
fair pivot
#

Thanks I’ll try that out today afternoon

outer hazelBOT
#

@fair pivot Has your question been resolved? If so, type !solved :)

fair pivot
#

!solved