Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate send_unicode_hex_string() #12602

Merged
merged 1 commit into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/feature_unicode.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");

Example uses include sending Unicode strings when a key is pressed, as described in [Macros](feature_macros.md).

### `send_unicode_hex_string()`
### `send_unicode_hex_string()` (Deprecated)

Similar to `send_unicode_string()`, but the characters are represented by their Unicode code points, written in hexadecimal and separated by spaces. For example, the table flip above would be achieved with:

Expand Down
32 changes: 16 additions & 16 deletions keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch(keycode) {
case CLOUD: // (っ◕‿◕)っ
case CLOUD:
if(record->event.pressed){
send_unicode_hex_string("0028 3063 25D5 203F 25D5 0029 3063");
send_unicode_string("(っ◕‿◕)っ");
}
return false;
break;
case FU: // t(-_-t)
case FU:
if(record->event.pressed){
SEND_STRING("t(-_-t)");
}
return false;
break;
case HAPPYFACE: // ʘ‿ʘ
case HAPPYFACE:
if(record->event.pressed){
send_unicode_hex_string("0298 203F 0298");
send_unicode_string("ʘ‿ʘ");
}
return false;
break;
Expand All @@ -118,33 +118,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case SHRUG: // ¯\_(ツ)_/¯
case SHRUG:
if (record->event.pressed) {
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
send_unicode_string("¯\\_(ツ)_/¯");
}
return false;
break;
case HEARTFACE: // ♥‿♥
case HEARTFACE:
if(record->event.pressed){
send_unicode_hex_string("2665 203F 2665");
send_unicode_string("♥‿♥");
}
return false;
break;
case DISFACE: // ಠ_ಠ
case DISFACE:
if(record->event.pressed){
send_unicode_hex_string("0CA0 005F 0CA0");
send_unicode_string("ಠ_ಠ");
}
return false;
break;
case TFLIP: // (╯°□°)╯ ︵ ┻━┻
case TFLIP:
if(record->event.pressed){
send_unicode_hex_string("0028 256F 00B0 25A1 00B0 0029 256F 0020 FE35 0020 253B 2501 253B");
send_unicode_string("(╯°□°)╯ ︵ ┻━┻");
}
return false;
break;
case TFLIP2: // ┻━┻︵ \(°□°)/ ︵ ┻━┻
case TFLIP2:
if(record->event.pressed){
send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B");
send_unicode_string("┻━┻︵ \\(°□°)/ ︵ ┻━┻");
}
return false;
break;
Expand Down Expand Up @@ -212,4 +212,4 @@ uint32_t layer_state_set_user(uint32_t state) {
break;
}
return state;
}
}
38 changes: 19 additions & 19 deletions keyboards/handwired/2x5keypad/keymaps/default_tapdance/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,36 @@ enum tap_codes {
A_Y, I_I, O_C, U_U
};

#define FR_A_GRAVE "00E0"
#define FR_A_HAT "00E2"
#define FR_A_GRAVE 0x00E0 // à
#define FR_A_HAT 0x00E2 // â

#define FR_C_CIRCUM "00E7"
#define FR_C_CIRCUM 0x00E7 // ç

#define FR_E_AIGU "00E9"
#define FR_E_GRAVE "00E8"
#define FR_E_HAT "00EA"
#define FR_E_UMLAUT "00EB"
#define FR_E_AIGU 0x00E9 // é
#define FR_E_GRAVE 0x00E8 // è
#define FR_E_HAT 0x00EA // ê
#define FR_E_UMLAUT 0x00EB // ë

#define FR_I_HAT "00EE"
#define FR_I_UMLAUT "00EF"
#define FR_I_HAT 0x00EE // î
#define FR_I_UMLAUT 0x00EF // ï

#define FR_O_HAT "00F4"
#define FR_O_HAT 0x00F4 // ô

#define FR_U_GRAVE "00F9"
#define FR_U_HAT "00FB"
#define FR_U_UMLAUT "00FC"
#define FR_U_GRAVE 0x00F9 // ù
#define FR_U_HAT 0x00FB // û
#define FR_U_UMLAUT 0x00FC // ü

#define FR_Y_UMLAUT "00FF"
#define FR_Y_UMLAUT 0x00FF // ÿ

#define FR_L_QUOTE "00AB"
#define FR_R_QUOTE "00BB"
#define FR_L_QUOTE 0x00AB // «
#define FR_R_QUOTE 0x00BB // »

void send_french_unicode_char(uint8_t count, char *once, char *twice)
void send_french_unicode_char(uint8_t count, uint32_t once, uint32_t twice)
{
if (count <= 1)
send_unicode_hex_string(once);
register_unicode(once);
else
send_unicode_hex_string(twice);
register_unicode(twice);
}

void dance_a_q(qk_tap_dance_state_t *state, void *user_data)
Expand Down
4 changes: 2 additions & 2 deletions keyboards/mechmini/v2/keymaps/wsturgiss/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void matrix_scan_user(void) {
//tableflip (LEADER - TF)
SEQ_TWO_KEYS(KC_T, KC_F) {
set_unicode_input_mode(UC_OSX);
send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
}
//screencap (LEADER - SC)
SEQ_TWO_KEYS(KC_S, KC_C) {
Expand All @@ -75,7 +75,7 @@ void matrix_scan_user(void) {
//screencap (LEADER - TM)
SEQ_TWO_KEYS(KC_T, KC_M) {
set_unicode_input_mode(UC_OSX);
send_unicode_hex_string("2122");
register_unicode(0x2122); // ™
}
/*
SEQ_THREE_KEYS(KC_D, KC_D, KC_S) {
Expand Down
24 changes: 12 additions & 12 deletions keyboards/spaceman/2_milk/keymaps/emoji/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ enum tapdance_keycodes {

void dance_key_one (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); // ¯\_(ツ)_/¯
SEND_STRING(SS_TAP(X_ENTER));
send_unicode_string("¯\\_(ツ)_/¯");
tap_code(KC_ENTER);
reset_tap_dance (state);
} else if (state->count == 2) {
cycle_unicode_input_mode(+1);
Expand All @@ -18,24 +18,24 @@ void dance_key_one (qk_tap_dance_state_t *state, void *user_data) {

void dance_key_two (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
send_unicode_hex_string("0CA0 005F 0CA0"); // ಠ_ಠ
SEND_STRING(SS_TAP(X_ENTER));
send_unicode_string("ಠ_ಠ");
tap_code(KC_ENTER);
reset_tap_dance (state);
} else if (state->count == 2) {
send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); // (ノಠ痊ಠ)ノ彡┻━┻
SEND_STRING(SS_TAP(X_ENTER));
send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
tap_code(KC_ENTER);
reset_tap_dance (state);
} else if (state->count == 3) {
send_unicode_hex_string("256D 2229 256E 0028 002D 005F 002D 0029 256D 2229 256E"); // ╭∩╮(-_-)╭∩╮
SEND_STRING(SS_TAP(X_ENTER));
send_unicode_string("╭∩╮(-_-)╭∩╮");
tap_code(KC_ENTER);
reset_tap_dance (state);
} else if (state->count == 4) {
send_unicode_hex_string("0028 3065 FFE3 0020 00B3 FFE3 0029 3065"); // (づ ̄ ³ ̄)づ
SEND_STRING(SS_TAP(X_ENTER));
send_unicode_string("(づ ̄ ³ ̄)づ");
tap_code(KC_ENTER);
reset_tap_dance (state);
} else if (state->count == 5) {
send_unicode_hex_string("0028 FE3A FE39 FE3A 0029"); // (︺︹︺)
SEND_STRING(SS_TAP(X_ENTER));
send_unicode_string("(︺︹︺)");
tap_code(KC_ENTER);
reset_tap_dance (state);
}
}
Expand Down
8 changes: 4 additions & 4 deletions keyboards/yatara/drink_me/keymaps/queen/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum td_keys {

void td_spade_lnx (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
send_unicode_hex_string("2660");
register_unicode(0x2660); // ♠
} else {
set_unicode_input_mode(UC_LNX);
}
Expand All @@ -21,7 +21,7 @@ void td_spade_lnx (qk_tap_dance_state_t *state, void *user_data) {

void td_diamond_osx (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
send_unicode_hex_string("2666");
register_unicode(0x2666); // ♦
} else {
set_unicode_input_mode(UC_OSX);
}
Expand All @@ -31,7 +31,7 @@ void td_diamond_osx (qk_tap_dance_state_t *state, void *user_data) {

void td_club_win (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
send_unicode_hex_string("2663");
register_unicode(0x2663); // ♣
} else {
set_unicode_input_mode(UC_WIN);
}
Expand All @@ -41,7 +41,7 @@ void td_club_win (qk_tap_dance_state_t *state, void *user_data) {

void td_heart_winc (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
send_unicode_hex_string("2665");
register_unicode(0x2665); // ♥
} else {
set_unicode_input_mode(UC_WINC);
}
Expand Down
26 changes: 10 additions & 16 deletions users/arkag/arkag.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void matrix_scan_user(void) {
surround_type(4, KC_GRAVE, true);
}
SEQ_ONE_KEY(KC_C) {
send_unicode_hex_string("00E7");
register_unicode(0x00E7); // ç
}
SEQ_TWO_KEYS(KC_A, KC_V) {
surround_type(2, KC_QUOT, true);
Expand All @@ -384,10 +384,10 @@ void matrix_scan_user(void) {
surround_type(6, KC_GRAVE, false);
}
SEQ_ONE_KEY(KC_E) {
send_unicode_hex_string("00E8");
register_unicode(0x00E8); // è
}
SEQ_TWO_KEYS(KC_E, KC_E) {
send_unicode_hex_string("00E9");
register_unicode(0x00E9); // é
}
// end format functions

Expand All @@ -407,8 +407,7 @@ void matrix_scan_user(void) {

// start typing functions
SEQ_TWO_KEYS(KC_T, KC_M) {
// ™
send_unicode_hex_string("2122");
register_unicode(0x2122); // ™
}
SEQ_TWO_KEYS(KC_D, KC_D) {
SEND_STRING(".\\Administrator");
Expand All @@ -420,27 +419,22 @@ void matrix_scan_user(void) {
tap_code(KC_ENTER);
}
SEQ_THREE_KEYS(KC_L, KC_O, KC_D) {
// ಠ__ಠ
send_unicode_hex_string("0CA0 005F 005F 0CA0");
send_unicode_string("ಠ__ಠ");
}
SEQ_THREE_KEYS(KC_M, KC_A, KC_P) {
SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag");
}
SEQ_TWO_KEYS(KC_F, KC_F) {
// (╯‵Д′)╯彡┻━┻
send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B");
send_unicode_string("(╯‵Д′)╯彡┻━┻");
}
SEQ_THREE_KEYS(KC_F, KC_F, KC_F) {
// ┬─┬ノ( º _ º ノ)
send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029");
send_unicode_string("┬─┬ノ( º _ º ノ)");
}
SEQ_THREE_KEYS(KC_L, KC_O, KC_L) {
// ( ͡° ͜ʖ ͡°)
send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029");
send_unicode_string("( ͡° ͜ʖ ͡°)");
}
SEQ_THREE_KEYS(KC_S, KC_S, KC_S) {
// ¯\_(ツ)_/¯
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
send_unicode_string("¯\\_(ツ)_/¯");
}
// end typing functions

Expand Down Expand Up @@ -513,7 +507,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

case M_DASH:
if (record->event.pressed){
send_unicode_hex_string("2014");
register_unicode(0x2014); // —
}
return false;
case M_LMHYP:
Expand Down
16 changes: 8 additions & 8 deletions users/curry/process_records.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
break;
#if defined(UNICODE_ENABLE)
case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
case UC_FLIP:
if (record->event.pressed) {
send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
}
break;
case UC_TABL: // ┬─┬ノ( º _ ºノ)
case UC_TABL:
if (record->event.pressed) {
send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029");
send_unicode_string("┬─┬ノ( º _ ºノ)");
}
break;
case UC_SHRG: // ¯\_(ツ)_/¯
case UC_SHRG:
if (record->event.pressed) {
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
send_unicode_string("¯\\_(ツ)_/¯");
}
break;
case UC_DISA: // ಠ_ಠ
case UC_DISA:
if (record->event.pressed) {
send_unicode_hex_string("0CA0 005F 0CA0");
send_unicode_string("ಠ_ಠ");
}
break;
#endif
Expand Down
Loading