瀏覽代碼

Syscall: Changed 'setkeymap' to take also the Shift+AltGr map.

Davide Carella 4 年之前
父節點
當前提交
ca9e0a70f5
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 1 0
      Kernel/API/Syscall.h
  2. 2 0
      Kernel/Syscalls/setkeymap.cpp

+ 1 - 0
Kernel/API/Syscall.h

@@ -336,6 +336,7 @@ struct SC_setkeymap_params {
     const u32* shift_map;
     const u32* alt_map;
     const u32* altgr_map;
+    const u32* shift_altgr_map;
     StringArgument map_name;
 };
 

+ 2 - 0
Kernel/Syscalls/setkeymap.cpp

@@ -50,6 +50,8 @@ int Process::sys$setkeymap(Userspace<const Syscall::SC_setkeymap_params*> user_p
         return -EFAULT;
     if (!copy_from_user(character_map_data.altgr_map, params.altgr_map, CHAR_MAP_SIZE * sizeof(u32)))
         return -EFAULT;
+    if (!copy_from_user(character_map_data.shift_altgr_map, params.shift_altgr_map, CHAR_MAP_SIZE * sizeof(u32)))
+        return -EFAULT;
 
     auto map_name = get_syscall_path_argument(params.map_name);
     if (map_name.is_error()) {