send keystroke command to player
973290
def _sendCommand(self, command):
        

        if(self.process is not None):
            try:
                if logger.isEnabledFor(logging.DEBUG):
                    logger.debug("Command: {}".format(command).strip())
                self.process.stdin.write(command.encode('utf-8', 'replace'))
                self.process.stdin.flush()
            except:
                msg = "Error when sending: {}"
                if logger.isEnabledFor(logging.ERROR):
                    logger.error(msg.format(command).strip(), exc_info=True)
884884
def KeyPress(self, key, n=1, delay=0):
        
        self._delay(delay)
        cmd = Command("KeyPress", 'KeyPress "%s", %s' % (key, n))
        self.add(cmd)
374368
def send_keys(pymux, variables):
    
    pane = pymux.arrangement.get_active_pane()

    if pane.display_scroll_buffer:
        raise CommandException('Cannot send keys. Pane is in copy mode.')

    for key in variables['<keys>']:
        # Translate key from pymux key to prompt_toolkit key.
        try:
            keys_sequence = pymux_key_to_prompt_toolkit_key_sequence(key)
        except ValueError:
            raise CommandException('Invalid key: %r' % (key, ))

        # Translate prompt_toolkit key to VT100 key.
        for k in keys_sequence:
            pane.process.write_key(k)
1127198
def ctrl_fn(self, i, pre_dl=None, post_dl=None):
        
        self.delay(pre_dl)
        self.k.press_key(self.k.control_key)
        self.k.tap_key(self.k.function_keys[i])
        self.k.release_key(self.k.control_key)
        self.delay(post_dl)
427415
function init(player) {  // {{{2
/**
 * @method constructor
 */

  this.timeout = 10 * 1000;

  this.target = player;

  this.actions = {
    mute: {
      command: 'mute',
      data: 'toggle',
      firstOnly: true,
    },
    stop: {
      command: 'stop',
      data: true,
      firstOnly: true,
    },
    pause: {
      command: 'pause',
      data: true,
      firstOnly: true,
    },
    play: {
      command: 'play',
      data: true,
      firstOnly: true,
    },
    playpause: {
      command: 'playPause',
      data: true,
      firstOnly: true,
    },
    forward: {
      command: 'next',
      data: true,
    },
    back: {
      command: 'previous',
      data: true,
    },
    volumeup: {
      command: 'volume',
      data: 'up'
    },
    volumedown: {
      command: 'volume',
      data: 'down'
    },
  };

  this.actions.rewind = this.actions.back;
}
1122364
def sendCommand(self, command):
        
        command_data = [ord(x) for x in buffer(command)]
        self.hid.write(command_data)
        response_data = ''.join(chr(x) for x in self.hid.read(64))
        response = command.RESPONSE.from_buffer_copy(response_data)
        if response.status != 0:
            raise CommandException(response.status)
        return response
1106573
def onSendCommand(self):
        ''''''
        self.agent_host.sendCommand(self.command_entry.get())
        self.command_entry.delete(0,END)
        self.canvas.focus_set()
305048
def control(self, key):
        """"""
        if not self.connection:
            raise exceptions.ConnectionClosed()

        payload = b"\x00\x00\x00" + self._serialize_string(key)
        packet = b"\x00\x00\x00" + self._serialize_string(payload, True)

        logging.info("Sending control command: %s", key)
        self.connection.send(packet)
        self._read_response()
        time.sleep(self._key_interval)
1254703
def send_command(self, command, arg=None):
    
    if arg is not None:
      command = '%s:%s' % (command, arg)
    self._write(six.StringIO(command), len(command))
102601
def key_press(self, key, x, y):
        ""
        if ord(key) == 27:
            # print "Escape!"
            if bool(glutLeaveMainLoop):
                glutLeaveMainLoop()
            else:
                raise Exception("Application quit")
1072541
def send_keyevents(self, keyevent: int) -> None:
        ''''''
        self._execute('-s', self.device_sn, 'shell',
                      'input', 'keyevent', str(keyevent))
458650
def SendCommand(self, command, arg=None):
        
        if arg is not None:
            if not isinstance(arg, bytes):
                arg = arg.encode('utf8')
            command = b'%s:%s' % (command, arg)

        self._Write(io.BytesIO(command), len(command))
832325
def send_command(self, command: str, *args, **kwargs):
        
        info = 'send command `%s` to bot. Args: %s | Kwargs: %s'
        self._messaging_logger.command.info(info, command, args, kwargs)

        command = command.encode('utf8')
        # target = target.encode('ascii')
        args = _json.dumps(args).encode('utf8')
        kwargs = _json.dumps(kwargs).encode('utf8')
        frame = (b'', command, args, kwargs)
        debug = ' send command run_control_loop: %s'
        self._messaging_logger.command.debug(debug, self._run_control_loop)

        if self._run_control_loop:
            self.add_callback(self.command_socket.send_multipart, frame)
        else:
            self.command_socket.send_multipart(frame)
1154215
def send(self, command, *, log=True):
        '''
        
        '''
        with self.sequence_number_mutex:
            self.sequence_number += 1
            packed = command._pack(self.sequence_number)
            self.send_bytes(packed, log=log)
836572
def sendcommand(self, cmd, opt=None):
        ""
        if cmd in [DO, DONT]:
            if not self.DOOPTS.has_key(opt):
                self.DOOPTS[opt] = None
            if (((cmd == DO) and (self.DOOPTS[opt] != True))
            or ((cmd == DONT) and (self.DOOPTS[opt] != False))):
                self.DOOPTS[opt] = (cmd == DO)
                self.writecooked(IAC + cmd + opt)
        elif cmd in [WILL, WONT]:
            if not self.WILLOPTS.has_key(opt):
                self.WILLOPTS[opt] = ''
            if (((cmd == WILL) and (self.WILLOPTS[opt] != True))
            or ((cmd == WONT) and (self.WILLOPTS[opt] != False))):
                self.WILLOPTS[opt] = (cmd == WILL)
                self.writecooked(IAC + cmd + opt)
        else:
            self.writecooked(IAC + cmd)
863916
def keyEvent(self, key, down=1):
        """"""
        self.transport.write(pack("!BBxxI", 4, down, key))
352126
def send_command(self, cmd):
        
        if not cmd:
            return

        with open(self.fifo, 'wb') as f:
            f.write(cmd)