summaryrefslogtreecommitdiffstats
path: root/users/drashna/send_unicode.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-10-02 03:00:14 +0200
committerJack Humbert <jack.humb@gmail.com>2018-10-02 03:00:14 +0200
commit1512a6bfd48fb75619a1f77394d41bdca7ea28b1 (patch)
tree54aea79710b4101b9fce20d4ff43d60eda24242b /users/drashna/send_unicode.c
parentf5ae3760c6be7e927fba74aca4a0cf21a44113af (diff)
downloadqmk_firmware-1512a6bfd48fb75619a1f77394d41bdca7ea28b1.tar.gz
qmk_firmware-1512a6bfd48fb75619a1f77394d41bdca7ea28b1.tar.xz
Keymap: Update to drashna keymaps and userspace (#3992)
* Enabled unicode support and send_unicode function * Unicode cleanup * More unicode tweaking * Update EEPROM stuff * Account for keyboard macros * Switch Equal to Plus on Ergodox * more tweaks * Minor Unicode tweaks * Correct matrix printing for keylogger * Fix unicode functions * Fix unicode mode set since it actually uses EEPROM * Re-add DISABLE_LEADER * Ergodox is easier to hit the tapping term, fix that * Fix stupid type on unicode mode check * Preliminary CRKBD/HeliDox support * Fixes to Helidox * Cleanup userspace from old merge stuff * Remove CCCV sounds * Make Mode NOEEPROM Again
Diffstat (limited to 'users/drashna/send_unicode.c')
-rw-r--r--users/drashna/send_unicode.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/users/drashna/send_unicode.c b/users/drashna/send_unicode.c
new file mode 100644
index 000000000..cacfe1dc8
--- /dev/null
+++ b/users/drashna/send_unicode.c
@@ -0,0 +1,58 @@
+// Written by konstantin: vomindoraan
+#include "send_unicode.h"
+#include <ctype.h>
+#include <string.h>
+
+__attribute__((weak))
+void send_unicode_hex_string(const char* str) {
+ if (!str) { return; } // Safety net
+
+ while (*str) {
+ // Find the next code point (token) in the string
+ for (; *str == ' '; str++);
+ size_t n = strcspn(str, " "); // Length of the current token
+ char code_point[n+1];
+ strncpy(code_point, str, n);
+ code_point[n] = '\0'; // Make sure it's null-terminated
+
+ // Normalize the code point: make all hex digits lowercase
+ for (char *p = code_point; *p; p++) {
+ *p = tolower((unsigned char)*p);
+ }
+
+ // Send the code point as a Unicode input string
+ unicode_input_start();
+ send_string(code_point);
+ unicode_input_finish();
+
+ str += n; // Move to the first ' ' (or '\0') after the current token
+ }
+}
+
+// (ノಠ痊ಠ)ノ彡┻━┻
+// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
+
+//Old code
+// (╯°□°)╯ ︵ ┻━┻
+ #if 0
+ register_code(KC_RSFT);
+ tap(KC_9);
+ unregister_code(KC_RSFT);
+ process_unicode((0x256F | QK_UNICODE), record); // Arm
+ process_unicode((0x00B0 | QK_UNICODE), record); // Eye
+ process_unicode((0x25A1 | QK_UNICODE), record); // Mouth
+ process_unicode((0x00B0 | QK_UNICODE), record); // Eye
+ register_code(KC_RSFT);
+ tap(KC_0);
+ unregister_code(KC_RSFT);
+ process_unicode((0x256F | QK_UNICODE), record); // Arm
+ tap(KC_SPC);
+ process_unicode((0x0361 | QK_UNICODE), record); // Flippy
+ tap(KC_SPC);
+ process_unicode((0x253B | QK_UNICODE), record); // Table
+ process_unicode((0x2501 | QK_UNICODE), record); // Table
+ process_unicode((0x253B | QK_UNICODE), record); // Table
+ #endif
+
+
+// If you need a good converter: https://r12a.github.io/app-conversion/