I am developing a game with Melon.Js, and down the canvas where it is loaded, I create a chat window. The problem is that when I type in the , if I press AWDS keys the character moves. Does anyone know how to temporarily disable (as long as the chat window on focus) character movement?
"game.html"
<div ng-controller="ChatController">
<div class="div-chat">
<span ng-repeat="msj in chats | orderBy: 'createdAt'"> <b ng-class=""> {{msj.nick}} : </b> {{msj.mensaje}} <br></span>
</div>
<input class="form-control" type="text" ng-model="mensaje" id="msjChat">
<button type="submit" class="btn btn-default" id="btn_enviar" ng-click="envMsj()">Enviar</button>
"player.js"
me.input.preventDefault;
me.input.bindKey(me.input.KEY.LEFT, 'left', false,false);
me.input.bindKey(me.input.KEY.A, 'left', false,false);
me.input.bindKey(me.input.KEY.RIGHT, 'right', false,false);
me.input.bindKey(me.input.KEY.D, 'right', false,false);
me.input.bindKey(me.input.KEY.UP, 'up', false,false);
me.input.bindKey(me.input.KEY.W, 'up', false,false);
me.input.bindKey(me.input.KEY.DOWN, 'down', false,false);
me.input.bindKey(me.input.KEY.S, 'down', false,false);
I try to use a "focus" in the input, but I cant disabled the movements in MelonJS canvas