Hey guys, I was trying to transfer a String from Node server to processing, the data do come in but when I do the conditional check, the msg == “8” returns false? Can anyone help me with this? Is there a datatype difference between java and js?
JS Code:
input.addEventListener("keydown",(event) =>{
if(event.which == 8){
socket.send("8");
}
});
In Processing:
//this will be executed whenever the server send a message;
void webSocketEvent(String msg){
println(msg); // print 8;
println(msg == "8"); //return false!!!
if(msg == "8"){
audienceTweet = audienceTweet.substring(0,audienceTweet.length()-1);
}else{
audienceTweet = audienceTweet + msg;
}
}