You can add an action to the on start of layout to download the contents of the dictionary as json.
This is what that string would look like:
So basically you could just concatenate your data with an &:
I'm now using czsx for right,left,up, down to send websocket messages. "right" "left" etc. are defined in the dictionary and Key "up" = 0 ... event triggers sprite simulate 8Direction up as per the first suggestion.
I can use the arrow keys and they work locally but do not send any websocket message. Since I haven't coded for multiplayer (all I'm doing on the server end is sending back a JSON string with right, left or whatever in it) ... using different keys to send the websocket message avoids the infinite looping.
What I'm getting now though is if I press S for up, for example, the sprite continues moving up until I click another button. I'll start looking. I think maybe there's a way to reset the value or something.