Skip to content

Commit

Permalink
Deprecate send_unicode_hex_string() (qmk#12602)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored May 13, 2021
1 parent 283f809 commit 6ff875a
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 87 deletions.
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
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
28 changes: 14 additions & 14 deletions users/d4mation/macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,75 +45,75 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ) {

#ifdef UNICODE_ENABLE

case AMENO: /* ༼ つ ◕_◕ ༽つ */
case AMENO:

if ( record->event.pressed ) {

send_unicode_hex_string( "0F3C 0020 3064 0020 25D5 005F 25D5 0020 0F3D 3064" );
send_unicode_string( "༼ つ ◕_◕ ༽つ" );

}

return false;
break;

case MAGIC: /* (∩ ͡° ͜ʖ ͡°)⊃━☆゚. * */
case MAGIC:

if ( record->event.pressed ) {

send_unicode_hex_string( "0028 2229 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029 2283 2501 2606 FF9F 002E 0020 002A" );
send_unicode_string( "(∩ ͡° ͜ʖ ͡°)⊃━☆゚. *" );

}

return false;
break;

case LENNY: /* ( ͡° ͜ʖ ͡°) */
case LENNY:

if ( record->event.pressed ) {

send_unicode_hex_string( "0028 0020 0361 00B0 0020 035C 0296 0020 0361 00b0 0029" );
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 FE35 253B 2501 253B" );
send_unicode_string( "(╯°□°)╯︵┻━┻" );

}

return false;
break;

case TPUT: /* ┬──┬ ノ( ゜-゜ノ) */
case TPUT:

if ( record->event.pressed ) {

send_unicode_hex_string( "252C 2500 2500 252C 0020 30CE 0028 0020 309C 002D 309C 30CE 0029" );
send_unicode_string( "┬──┬ ノ( ゜-゜ノ)" );

}

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( "¯\\_(ツ)_/¯" );

}

Expand Down
16 changes: 8 additions & 8 deletions users/kuchosauronad0/process_records.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

// Unicode
#ifdef 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 //!Unicode
Expand Down
2 changes: 0 additions & 2 deletions users/kuchosauronad0/unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#include "quantum.h"

void send_unicode_hex_string(const char* str);

/* use X(n) to call the */
#ifdef UNICODEMAP_ENABLE
enum unicode_name {
Expand Down
Loading

0 comments on commit 6ff875a

Please sign in to comment.