Browse Source

Kernel: Replace char and u8 data types to u32 for code point

Remove character property from event and add code_point property.
Hüseyin ASLITÜRK 5 years ago
parent
commit
174987f930
4 changed files with 10 additions and 10 deletions
  1. 1 1
      Kernel/Devices/KeyboardDevice.cpp
  2. 1 1
      Kernel/KeyCode.h
  3. 4 4
      Kernel/Process.cpp
  4. 4 4
      Kernel/Syscall.h

+ 1 - 1
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;

+ 1 - 1
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 };

+ 4 - 4
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;

+ 4 - 4
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 {