From 174987f930e38c5fd7335c85f87e06c39b2d5b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ASLIT=C3=9CRK?= Date: Thu, 11 Jun 2020 21:26:05 +0300 Subject: [PATCH] Kernel: Replace char and u8 data types to u32 for code point Remove character property from event and add code_point property. --- Kernel/Devices/KeyboardDevice.cpp | 2 +- Kernel/KeyCode.h | 2 +- Kernel/Process.cpp | 8 ++++---- Kernel/Syscall.h | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Kernel/Devices/KeyboardDevice.cpp b/Kernel/Devices/KeyboardDevice.cpp index 99c30e42b0..01a34c8534 100644 --- a/Kernel/Devices/KeyboardDevice.cpp +++ b/Kernel/Devices/KeyboardDevice.cpp @@ -265,7 +265,7 @@ void KeyboardDevice::key_state_changed(u8 scan_code, bool pressed) event.flags = m_modifiers; event.e0_prefix = m_has_e0_prefix; event.caps_lock_on = m_caps_lock_on; - event.character = m_character_map.get_char(event); + event.code_point = m_character_map.get_char(event); if (pressed) event.flags |= Is_Press; diff --git a/Kernel/KeyCode.h b/Kernel/KeyCode.h index 5d9dd92935..d8454f90d0 100644 --- a/Kernel/KeyCode.h +++ b/Kernel/KeyCode.h @@ -161,7 +161,7 @@ enum KeyModifier { struct KeyEvent { KeyCode key { Key_Invalid }; u32 scancode { 0 }; - u8 character { 0 }; + u32 code_point { 0 }; u8 flags { 0 }; bool caps_lock_on { false }; bool e0_prefix { false }; diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index f85a0e7299..568648401e 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -4305,10 +4305,10 @@ int Process::sys$setkeymap(const Syscall::SC_setkeymap_params* user_params) Keyboard::CharacterMapData character_map_data; - const char* map = params.map; - const char* shift_map = params.shift_map; - const char* alt_map = params.alt_map; - const char* altgr_map = params.altgr_map; + const u32* map = params.map; + const u32* shift_map = params.shift_map; + const u32* alt_map = params.alt_map; + const u32* altgr_map = params.altgr_map; if (!validate_read(map, CHAR_MAP_SIZE)) return -EFAULT; diff --git a/Kernel/Syscall.h b/Kernel/Syscall.h index 15bc2c31c2..e2be796eb0 100644 --- a/Kernel/Syscall.h +++ b/Kernel/Syscall.h @@ -325,10 +325,10 @@ struct SC_futex_params { }; struct SC_setkeymap_params { - const char* map; - const char* shift_map; - const char* alt_map; - const char* altgr_map; + const u32* map; + const u32* shift_map; + const u32* alt_map; + const u32* altgr_map; }; struct SC_create_thread_params {