@@ -68,8 +68,9 @@ input_dispatcher::new_input(const struct timeval& current_time,
6868 std::string eff_str;
6969
7070 for (size_t lpc = 0 ; ch.eff_text [lpc]; lpc++) {
71- fmt::format_to (
72- std::back_inserter (eff_str), FMT_STRING (" {:02x}" ), ch.eff_text [lpc]);
71+ fmt::format_to (std::back_inserter (eff_str),
72+ FMT_STRING (" {:02x}" ),
73+ ch.eff_text [lpc]);
7374 }
7475 log_debug (" new input %x %d/%x(%c)/%s/%s evtype=%d" ,
7576 ch.modifiers ,
@@ -110,19 +111,11 @@ input_dispatcher::new_input(const struct timeval& current_time,
110111 log_debug (" nckey %s" , keyseq.data ());
111112 handled = this ->id_key_handler (nc, ch, keyseq.data ());
112113 } else {
113- auto seq_size = utf::utf8::char_size ([&ch]() {
114- return std::make_pair (ch.eff_text [0 ], 16 );
115- }).unwrapOr (size_t {1 });
116- log_debug (" seq_size %d" , seq_size);
117- if (seq_size == 1 ) {
118- snprintf (
119- keyseq.data (), keyseq.size (), " x%02x" , ch.eff_text [0 ] & 0xff );
120- log_debug (" key %s" , keyseq.data ());
121- handled = this ->id_key_handler (nc, ch, keyseq.data ());
122- }
114+ to_key_seq (keyseq, ch.utf8 );
115+ handled = this ->id_key_handler (nc, ch, keyseq.data ());
123116 }
124117
125118 if (handled && !handled.value ()) {
126119 this ->id_unhandled_handler (keyseq.data ());
127120 }
128- }
121+ }
0 commit comments