Skip to content

Instantly share code, notes, and snippets.

@igkuz
Created August 1, 2013 15:12
Show Gist options
  • Save igkuz/6132304 to your computer and use it in GitHub Desktop.
Save igkuz/6132304 to your computer and use it in GitHub Desktop.
remoteAcquireControl: function () {
var controlMap = {};
controlMap[R.Keys.Left] = "onKeyPressLeft";
controlMap[R.Keys.Right] = "onKeyPressRight";
root.rcu = function (event) {
console.log("Control receive", event);
var handler = this[controlMap[event.code]]
if (!handler) return true;
var handleResult = handler.call(this, event);
console.log(handleResult);
if (handleResult){ R.makeFlush(event); }
// Не прокидываем событие в СФК
return false;
}.bind(this);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment