Send keys to the device.
358365
def send_keys(self, keys):
        """"""
        try:
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.settimeout(self._timeout)
            sock.connect((self._ip, self._port['cmd']))
            # mandatory dance
            version_info = sock.recv(15)
            sock.send(version_info)
            sock.recv(2)
            sock.send(bytes.fromhex('01'))
            sock.recv(4)
            sock.recv(24)
            # send our command now!
            for key in keys:
                if key in self._keys:
                    sock.send(bytes.fromhex("04 01 00 00 00 00 " +
                                            self._keys[key]))
                    sock.send(bytes.fromhex("04 00 00 00 00 00 " +
                                            self._keys[key]))
            sock.close()
        except socket.error:
            raise
34948
def send_keys(self, text: str = 'cerium') -> None:
        ''''''
        for char in text:
            if '\u4e00' <= char <= '\u9fff':
                raise CharactersException(
                    f'Text cannot contain non-English characters, such as {char!r}.')
        text = re.escape(text)
        self._execute('-s', self.device_sn, 'shell',
                      'input', 'text', text)
450615
def Write(self, data):
        """"""
        self._Send(b'WRTE', arg0=self.local_id, arg1=self.remote_id, data=data)
        # Expect an ack in response.
        cmd, okay_data = self.ReadUntil(b'OKAY')
        if cmd != b'OKAY':
            if cmd == b'FAIL':
                raise usb_exceptions.AdbCommandFailureException(
                    'Command failed.', okay_data)
            raise InvalidCommandError(
                'Expected an OKAY in response to a WRITE, got %s (%s)',
                cmd, okay_data)
        return len(data)
168111
def Send(self, usb, timeout_ms=None):
        """"""
        usb.BulkWrite(self.Pack(), timeout_ms)
        usb.BulkWrite(self.data, timeout_ms)
463639
def massage_keys(keys):
    """"""
    m_keys = []
    for key in keys:
        if key.startswith('keybase:'):
            m_keys.append(cryptorito.key_from_keybase(key[8:])['fingerprint'])
        else:
            m_keys.append(key)

    return m_keys
1040384
def send_keys(self, element, x):
        
        ActionChains(self.driver) \
            .send_keys_to_element(element, x) \
            .perform()
672005
def SendKeys(keys,
             pause=0.05,
             with_spaces=False,
             with_tabs=False,
             with_newlines=False,
             turn_off_numlock=True):
    ""
    keys = parse_keys(keys, with_spaces, with_tabs, with_newlines)

    for k in keys:
        k.Run()
        time.sleep(pause)
1008290
def send(kwargs, opts):
    '''
    
    '''
    opt_keys = (
        'smtp.to',
        'smtp.from',
        'smtp.host',
        'smtp.port',
        'smtp.tls',
        'smtp.username',
        'smtp.password',
        'smtp.subject',
        'smtp.gpgowner',
        'smtp.content',
    )

    config = {}
    for key in opt_keys:
        config[key] = opts.get(key, '')

    config.update(kwargs)

    if not config['smtp.port']:
        config['smtp.port'] = 25

    log.debug('SMTP port has been set to %s', config['smtp.port'])
    log.debug("smtp_return: Subject is '%s'", config['smtp.subject'])

    if HAS_GNUPG and config['smtp.gpgowner']:
        gpg = gnupg.GPG(
            gnupghome=os.path.expanduser(
                '~{0}/.gnupg'.format(config['smtp.gpgowner'])
            ),
            options=['--trust-model always']
        )
        encrypted_data = gpg.encrypt(config['smtp.content'], config['smtp.to'])
        if encrypted_data.ok:
            log.debug('smtp_return: Encryption successful')
            config['smtp.content'] = six.text_type(encrypted_data)
        else:
            log.error(
                'SMTP: Encryption failed, only an error message will be sent'
            )
            config['smtp.content'] = (
                'Encryption failed, the return data was not sent.'
                '\r\n\r\n{0}\r\n{1}'
            ).format(encrypted_data.status, encrypted_data.stderr)

    message = (
        'From: {0}\r\n'
        'To: {1}\r\n'
        'Date: {2}\r\n'
        'Subject: {3}\r\n'
        '\r\n'
        '{4}'
    ).format(
        config['smtp.from'],
        config['smtp.to'],
        formatdate(localtime=True),
        config['smtp.subject'],
        config['smtp.content'],
    )

    log.debug('smtp_return: Connecting to the server...')
    server = smtplib.SMTP(config['smtp.host'], int(config['smtp.port']))

    if config['smtp.tls'] is True:
        server.starttls()
        log.debug('smtp_return: TLS enabled')

    if config['smtp.username'] and config['smtp.password']:
        server.login(config['smtp.username'], config['smtp.password'])
        log.debug('smtp_return: Authenticated')

    server.sendmail(config['smtp.from'], config['smtp.to'], message)
    log.debug('smtp_return: Message sent.')
    server.quit()
595617
public void send(CharSequence text) {
    int currentIndex = 0;
    while (currentIndex < text.length()) {
      char currentCharacter = text.charAt(currentIndex);
      if (AndroidKeys.hasAndroidKeyEvent(currentCharacter)) {
        // The next character is special and must be sent individually
        int keyCode = AndroidKeys.keyCodeFor(currentCharacter);
        if (keyCode == KeyEvent.KEYCODE_HOME) {
          throw new RuntimeException(
              "It is not possible to simulate the HOME key using instrumentation. " +
              "Please use adb, e.g. 'adb shell input keyevent 3'.");
        }
        SelendroidLogger.debug("Send keys, sending special key code");
        instrumentation.sendKeyDownUpSync(keyCode);
        currentIndex++;
      } else {
        // There is at least one "normal" character, that is a character
        // represented by a plain Unicode character that can be sent with
        // sendStringSync. So send as many such consecutive normal characters
        // as possible in a single String.
        int nextSpecialKey = indexOfSpecialKey(text, currentIndex);
        SelendroidLogger.debug("Send keys, sending string");
        instrumentation.sendStringSync(text.subSequence(currentIndex, nextSpecialKey).toString());
        currentIndex = nextSpecialKey;
      }
    }
  }
439910
def send_KeyEvent(self, key, down):
        
        self.sendMessage(struct.pack('!BBxxI', 4, down, key))
1190221
def send_key(self, key, repeat=1):
                
        for _ in range(repeat):
            self.mediator.send_key(key)
        self.mediator.flush()
405048
def _send(self, data):
        """"""
        if not self._sock:
            self.connect()
        self._do_send(data)
890317
def send_keycode(keycode)
      send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::DOWN))
      send_request RequestMessage.new(key_event_message: KeyEvent.new(keycode: keycode, action: Action::UP))
    end
674409
public void sendKey(int key)
	{
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "sendKey("+key+")");
		}
		
		sender.sendKeyCode(key);
	}
679938
def press_keys(self,characters=[]):
        """"""
        for character in characters:
            self.press_key(character)
        for character in characters:
            self.release_key(character)
935167
def send(self, data):
        """"""
        # send message
        _LOGGER.debug("send: " + data)
        self.socket.send(data.encode('ascii'))
        # sleep needed to prevent flooding the GC100 with sends
        sleep(.01)
1344703
public void sendKeys(final By by, final CharSequence... keysToSend) {
		checkTopmostElement(by);
		findElement(by).sendKeys(keysToSend);
	}