UNPKG

rkeys

Version:

A platform for creating tablet/HTML5 virtual-keyboard apps to send keystrokes to remote X11

27 lines (26 loc) 731 B
// Generated by LiveScript 1.3.0 (function(){ var _, D, S, split$ = ''.split, join$ = [].join; _ = require('lodash'); D = require('../constants').directions; S = require('../../ws/server'); module.exports = function(arg$){ var command, direction, id, cmdarr; command = arg$.command, direction = arg$.direction, id = arg$.id; if (command == null) { return false; } if (_.isArray(command)) { command = command[direction]; } else { if (direction !== D.DOWN) { return; } } if ((cmdarr = split$.call(command, ' '))[0] !== 'broadcast') { return false; } S.broadcast(cmdarr[1], join$.call(cmdarr.slice(2), ' ')); return true; }; }).call(this);