qmk_firmware/internals/send_string.md

6.1 KiB

group send_string

Send String API. These functions allow you to create macros by typing out sequences of keystrokes.

Summary

Members Descriptions
define KCLUT_ENTRY
define SEND_STRING Shortcut macro for send_string_with_delay_P(PSTR(string), 0).
define SEND_STRING_DELAY Shortcut macro for send_string_with_delay_P(PSTR(string), interval).
public void send_string(const char * string) Type out a string of ASCII characters.
public void send_string_with_delay(const char * string,uint8_t interval) Type out a string of ASCII characters, with a delay between each character.
public void send_char(char ascii_code) Type out an ASCII character.
public void send_dword(uint32_t number) Type out an eight digit (unsigned 32-bit) hexadecimal value.
public void send_word(uint16_t number) Type out a four digit (unsigned 16-bit) hexadecimal value.
public void send_byte(uint8_t number) Type out a two digit (8-bit) hexadecimal value.
public void send_nibble(uint8_t number) Type out a single hexadecimal digit.
public void tap_random_base64(void) Type a pseudorandom character from the set A-Z, a-z, 0-9, + and /.
public void send_string_P(const char * string) Type out a PROGMEM string of ASCII characters.
public void send_string_with_delay_P(const char * string,uint8_t interval) Type out a PROGMEM string of ASCII characters, with a delay between each character.

Members

define KCLUT_ENTRY

define SEND_STRING

Shortcut macro for send_string_with_delay_P(PSTR(string), 0).

On ARM devices, this define evaluates to send_string_with_delay(string, 0).

define SEND_STRING_DELAY

Shortcut macro for send_string_with_delay_P(PSTR(string), interval).

On ARM devices, this define evaluates to send_string_with_delay(string, interval).

public void send_string(const char * string)

Type out a string of ASCII characters.

This function simply calls send_string_with_delay(string, 0).

Most keycodes from the basic keycode range are also supported by way of a special sequence - see [send_string_keycodes.h](#send__string__keycodes_8h_source).

Parameters

  • string The string to type out.

public void send_string_with_delay(const char * string,uint8_t interval)

Type out a string of ASCII characters, with a delay between each character.

Parameters

  • string The string to type out.

  • interval The amount of time, in milliseconds, to wait before typing the next character.

public void send_char(char ascii_code)

Type out an ASCII character.

Parameters

  • ascii_code The character to type.

public void send_dword(uint32_t number)

Type out an eight digit (unsigned 32-bit) hexadecimal value.

The format is [0-9a-f]{8}, eg. 00000000 through ffffffff.

Parameters

  • number The value to type, from 0 to 4,294,967,295.

public void send_word(uint16_t number)

Type out a four digit (unsigned 16-bit) hexadecimal value.

The format is [0-9a-f]{4}, eg. 0000 through ffff.

Parameters

  • number The value to type, from 0 to 65,535.

public void send_byte(uint8_t number)

Type out a two digit (8-bit) hexadecimal value.

The format is [0-9a-f]{2}, eg. 00 through ff.

Parameters

  • number The value to type, from 0 to 255.

public void send_nibble(uint8_t number)

Type out a single hexadecimal digit.

The format is [0-9a-f]{1}, eg. 0 through f.

Parameters

  • number The value to type, from 0 to 15.

public void tap_random_base64(void)

Type a pseudorandom character from the set A-Z, a-z, 0-9, + and /.

public void send_string_P(const char * string)

Type out a PROGMEM string of ASCII characters.

On ARM devices, this function is simply an alias for send_string_with_delay(string, 0).

Parameters

  • string The string to type out.

public void send_string_with_delay_P(const char * string,uint8_t interval)

Type out a PROGMEM string of ASCII characters, with a delay between each character.

On ARM devices, this function is simply an alias for send_string_with_delay(string, interval).

Parameters

  • string The string to type out.

  • interval The amount of time, in milliseconds, to wait before typing the next character.