16 text_cursor_char_left,
17 text_cursor_char_right,
18 text_cursor_word_left,
19 text_cursor_word_right,
20 text_cursor_line_begin,
22 text_select_char_left,
23 text_select_char_right,
25 text_select_word_left,
26 text_select_word_right,
27 text_select_line_begin,
31 text_delete_char_prev,
32 text_delete_char_next,
53constexpr char const *to_const_string(command rhs)
noexcept
56 case command::unknown:
return "unknown";
57 case command::text_cursor_char_left:
return "text_cursor_char_left";
58 case command::text_cursor_char_right:
return "text_cursor_char_right";
59 case command::text_cursor_word_left:
return "text_cursor_word_left";
60 case command::text_cursor_word_right:
return "text_cursor_word_right";
61 case command::text_cursor_line_begin:
return "text_cursor_line_begin";
62 case command::text_cursor_line_end:
return "text_cursor_line_end";
63 case command::text_select_char_left:
return "text_select_char_left";
64 case command::text_select_char_right:
return "text_select_char_right";
65 case command::text_select_word:
return "text_select_word";
66 case command::text_select_word_left:
return "text_select_word_left";
67 case command::text_select_word_right:
return "text_select_word_right";
68 case command::text_select_line_begin:
return "text_select_line_begin";
69 case command::text_select_line_end:
return "text_select_line_end";
70 case command::text_select_document:
return "text_select_document";
71 case command::text_mode_insert:
return "text_mode_insert";
72 case command::text_delete_char_prev:
return "text_delete_char_prev";
73 case command::text_delete_char_next:
return "text_delete_char_next";
74 case command::text_edit_paste:
return "text_edit_paste";
75 case command::text_edit_copy:
return "text_edit_copy";
76 case command::text_edit_cut:
return "text_edit_cut";
77 case command::text_undo:
return "text_undo";
78 case command::text_redo:
return "text_redo";
79 case command::gui_keyboard_enter:
return "gui_keyboard_enter";
80 case command::gui_keyboard_exit:
return "gui_keyboard_exit";
81 case command::gui_mouse_enter:
return "gui_mouse_enter";
82 case command::gui_mouse_exit:
return "gui_mouse_exit";
83 case command::gui_widget_next:
return "gui_widget_next";
84 case command::gui_widget_prev:
return "gui_widget_prev";
85 case command::gui_menu_next:
return "gui_menu_next";
86 case command::gui_menu_prev:
return "gui_menu_prev";
87 case command::gui_toolbar_next:
return "gui_toolbar_next";
88 case command::gui_toolbar_prev:
return "gui_toolbar_prev";
89 case command::gui_activate:
return "gui_activate";
90 case command::gui_enter:
return "gui_enter";
91 case command::gui_escape:
return "gui_escape";
98 return to_const_string(rhs);
102 return lhs << to_const_string(rhs);
105constexpr command to_command(std::string_view name)
noexcept
107 if (name ==
"text_cursor_char_left") {
108 return command::text_cursor_char_left;
109 }
else if (name ==
"text_cursor_char_right") {
110 return command::text_cursor_char_right;
111 }
else if (name ==
"text_cursor_word_left") {
112 return command::text_cursor_word_left;
113 }
else if (name ==
"text_cursor_word_right") {
114 return command::text_cursor_word_right;
115 }
else if (name ==
"text_cursor_line_begin") {
116 return command::text_cursor_line_begin;
117 }
else if (name ==
"text_cursor_line_end") {
118 return command::text_cursor_line_end;
119 }
else if (name ==
"text_select_char_left") {
120 return command::text_select_char_left;
121 }
else if (name ==
"text_select_char_right") {
122 return command::text_select_char_right;
123 }
else if (name ==
"text_select_word") {
124 return command::text_select_word;
125 }
else if (name ==
"text_select_word_left") {
126 return command::text_select_word_left;
127 }
else if (name ==
"text_select_word_right") {
128 return command::text_select_word_right;
129 }
else if (name ==
"text_select_line_begin") {
130 return command::text_select_line_begin;
131 }
else if (name ==
"text_select_line_end") {
132 return command::text_select_line_end;
133 }
else if (name ==
"text_select_document") {
134 return command::text_select_document;
135 }
else if (name ==
"text_mode_insert") {
136 return command::text_mode_insert;
137 }
else if (name ==
"text_delete_char_prev") {
138 return command::text_delete_char_prev;
139 }
else if (name ==
"text_delete_char_next") {
140 return command::text_delete_char_next;
141 }
else if (name ==
"text_edit_paste") {
142 return command::text_edit_paste;
143 }
else if (name ==
"text_edit_copy") {
144 return command::text_edit_copy;
145 }
else if (name ==
"text_edit_cut") {
146 return command::text_edit_cut;
147 }
else if (name ==
"text_undo") {
148 return command::text_undo;
149 }
else if (name ==
"text_redo") {
150 return command::text_redo;
151 }
else if (name ==
"gui_keyboard_enter") {
152 return command::gui_keyboard_enter;
153 }
else if (name ==
"gui_keyboard_exit") {
154 return command::gui_keyboard_exit;
155 }
else if (name ==
"gui_mouse_enter") {
156 return command::gui_mouse_enter;
157 }
else if (name ==
"gui_mouse_exit") {
158 return command::gui_mouse_exit;
159 }
else if (name ==
"gui_widget_next") {
160 return command::gui_widget_next;
161 }
else if (name ==
"gui_widget_prev") {
162 return command::gui_widget_prev;
163 }
else if (name ==
"gui_menu_next") {
164 return command::gui_menu_next;
165 }
else if (name ==
"gui_menu_prev") {
166 return command::gui_menu_prev;
167 }
else if (name ==
"gui_toolbar_next") {
168 return command::gui_toolbar_next;
169 }
else if (name ==
"gui_toolbar_prev") {
170 return command::gui_toolbar_prev;
171 }
else if (name ==
"gui_activate") {
172 return command::gui_activate;
173 }
else if (name ==
"gui_enter") {
174 return command::gui_enter;
175 }
else if (name ==
"gui_escape") {
176 return command::gui_escape;
178 return command::unknown;