summaryrefslogtreecommitdiffstats
path: root/quantum/unicode/unicode.h
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-08-27 13:30:19 +1000
committerGitHub <noreply@github.com>2023-08-27 13:30:19 +1000
commit70e34e491c297231a3f987fd69760d38e79dbfa4 (patch)
treea3fe26ea27c9d020142f4c248fa0bab5d32c1f9c /quantum/unicode/unicode.h
parent95681b8ff4a92aacd0249e124d34cf16e510175e (diff)
Unicode, Unicodemap and UCIS refactor (#21659)
Diffstat (limited to 'quantum/unicode/unicode.h')
-rw-r--r--quantum/unicode/unicode.h81
1 files changed, 77 insertions, 4 deletions
diff --git a/quantum/unicode/unicode.h b/quantum/unicode/unicode.h
index fc0e9d3d2b..90a54c8b18 100644
--- a/quantum/unicode/unicode.h
+++ b/quantum/unicode/unicode.h
@@ -19,6 +19,13 @@
#include <stdint.h>
#include "unicode_keycodes.h"
+/**
+ * \file
+ *
+ * \defgroup unicode Unicode
+ * \{
+ */
+
typedef union {
uint8_t raw;
struct {
@@ -41,21 +48,87 @@ enum unicode_input_modes {
UNICODE_MODE_COUNT // Number of available input modes (always leave at the end)
};
-void unicode_input_mode_init(void);
+void unicode_input_mode_init(void);
+
+/**
+ * \brief Get the current Unicode input mode.
+ *
+ * \return The currently active Unicode input mode.
+ */
uint8_t get_unicode_input_mode(void);
-void set_unicode_input_mode(uint8_t mode);
-void cycle_unicode_input_mode(int8_t offset);
-void persist_unicode_input_mode(void);
+/**
+ * \brief Set the Unicode input mode.
+ *
+ * \param mode The input mode to set.
+ */
+void set_unicode_input_mode(uint8_t mode);
+
+/**
+ * \brief Change to the next Unicode input mode.
+ */
+void unicode_input_mode_step(void);
+
+/**
+ * \brief Change to the previous Unicode input mode.
+ */
+void unicode_input_mode_step_reverse(void);
+
+/**
+ * \brief User-level callback, invoked when the input mode is changed.
+ *
+ * \param input_mode The new input mode.
+ */
void unicode_input_mode_set_user(uint8_t input_mode);
+
+/**
+ * \brief Keyboard-level callback, invoked when the input mode is changed.
+ *
+ * \param input_mode The new input mode.
+ */
void unicode_input_mode_set_kb(uint8_t input_mode);
+/**
+ * \brief Begin the Unicode input sequence. The exact behavior depends on the currently selected input mode.
+ */
void unicode_input_start(void);
+
+/**
+ * \brief Complete the Unicode input sequence. The exact behavior depends on the currently selected input mode.
+ */
void unicode_input_finish(void);
+
+/**
+ * \brief Cancel the Unicode input sequence. The exact behavior depends on the currently selected input mode.
+ */
void unicode_input_cancel(void);
+/**
+ * \brief Send a 16-bit hex number.
+ *
+ * \param hex The number to send.
+ */
void register_hex(uint16_t hex);
+
+/**
+ * \brief Send a 32-bit hex number.
+ *
+ * \param hex The number to send.
+ */
void register_hex32(uint32_t hex);
+
+/**
+ * \brief Input a single Unicode character. A surrogate pair will be sent if required by the input mode.
+ *
+ * \param code_point The code point of the character to send.
+ */
void register_unicode(uint32_t code_point);
+/**
+ * \brief Send a string containing Unicode characters.
+ *
+ * \param str The string to send.
+ */
void send_unicode_string(const char *str);
+
+/** \} */