mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
KeyboardMapper: Replace char data type to u32 for code point
This commit is contained in:
parent
2f7e5a5e40
commit
1887e35dc8
2 changed files with 4 additions and 5 deletions
|
@ -94,4 +94,3 @@ void KeyButton::leave_event(Core::Event& event)
|
||||||
window()->set_override_cursor(GUI::StandardCursor::Arrow);
|
window()->set_override_cursor(GUI::StandardCursor::Arrow);
|
||||||
AbstractButton::leave_event(event);
|
AbstractButton::leave_event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ void KeyboardMapperWidget::create_frame()
|
||||||
ASSERT(index > 0);
|
ASSERT(index > 0);
|
||||||
|
|
||||||
tmp_button.set_text(value);
|
tmp_button.set_text(value);
|
||||||
char* map;
|
u32* map;
|
||||||
|
|
||||||
if (m_current_map_name == "map") {
|
if (m_current_map_name == "map") {
|
||||||
map = m_character_map.map;
|
map = m_character_map.map;
|
||||||
|
@ -176,7 +176,7 @@ void KeyboardMapperWidget::save_to_file(const StringView& file_name)
|
||||||
{
|
{
|
||||||
JsonObject map_json;
|
JsonObject map_json;
|
||||||
|
|
||||||
auto add_array = [&](String name, char* values) {
|
auto add_array = [&](String name, u32* values) {
|
||||||
JsonArray items;
|
JsonArray items;
|
||||||
for (int i = 0; i < 90; i++) {
|
for (int i = 0; i < 90; i++) {
|
||||||
AK::StringBuilder sb;
|
AK::StringBuilder sb;
|
||||||
|
@ -249,7 +249,7 @@ void KeyboardMapperWidget::keyup_event(GUI::KeyEvent& event)
|
||||||
void KeyboardMapperWidget::set_current_map(const String current_map)
|
void KeyboardMapperWidget::set_current_map(const String current_map)
|
||||||
{
|
{
|
||||||
m_current_map_name = current_map;
|
m_current_map_name = current_map;
|
||||||
char* map;
|
u32* map;
|
||||||
|
|
||||||
if (m_current_map_name == "map") {
|
if (m_current_map_name == "map") {
|
||||||
map = m_character_map.map;
|
map = m_character_map.map;
|
||||||
|
@ -269,7 +269,7 @@ void KeyboardMapperWidget::set_current_map(const String current_map)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AK::StringBuilder sb;
|
AK::StringBuilder sb;
|
||||||
sb.append(map[index]);
|
sb.append_codepoint(map[index]);
|
||||||
|
|
||||||
m_keys.at(k)->set_text(sb.to_string());
|
m_keys.at(k)->set_text(sb.to_string());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue