From 047dbfd44ba7743851d8457e60d0879db6f18e1c Mon Sep 17 00:00:00 2001 From: LoGin Date: Sun, 29 Sep 2024 03:15:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(kbd):=20=E4=BF=AE=E5=A4=8D=E9=94=AE?= =?UTF-8?q?=E7=9B=98=E5=91=BD=E4=BB=A4=E8=A7=A3=E6=9E=90=E5=99=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=9A=84=E5=AD=97=E8=8A=82=E7=A0=81=E4=B8=8ELinux?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98=20(#946)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: longjin --- kernel/src/libs/keyboard_parser.rs | 33 ++++++++++++++++++-------- user/dadk/config/nova_shell-0.1.0.dadk | 2 +- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/kernel/src/libs/keyboard_parser.rs b/kernel/src/libs/keyboard_parser.rs index 2cfe57b3..ff69e132 100644 --- a/kernel/src/libs/keyboard_parser.rs +++ b/kernel/src/libs/keyboard_parser.rs @@ -176,6 +176,9 @@ impl TypeOneFSMState { } 0x47 => { scancode_status.home = true; + Self::emit(0x1b); + Self::emit(0x5b); + Self::emit(0x48); } 0xc7 => { scancode_status.home = false; @@ -188,13 +191,19 @@ impl TypeOneFSMState { } 0x53 => { scancode_status.del = true; - Self::emit(127); + Self::emit(0x1b); + Self::emit(0x5b); + Self::emit(0x33); + Self::emit(0x7e); } 0xd3 => { scancode_status.del = false; } 0x4f => { scancode_status.end = true; + Self::emit(0x1b); + Self::emit(0x5b); + Self::emit(0x46); } 0xcf => { scancode_status.end = false; @@ -207,32 +216,36 @@ impl TypeOneFSMState { } 0x48 => { scancode_status.arrow_u = true; - Self::emit(224); - Self::emit(72); + Self::emit(0x1b); + Self::emit(0x5b); + Self::emit(0x41); } 0xc8 => { scancode_status.arrow_u = false; } 0x4b => { scancode_status.arrow_l = true; - Self::emit(224); - Self::emit(75); + Self::emit(0x1b); + Self::emit(0x5b); + Self::emit(0x44); } 0xcb => { scancode_status.arrow_l = false; } 0x50 => { scancode_status.arrow_d = true; - Self::emit(224); - Self::emit(80); + Self::emit(0x1b); + Self::emit(0x5b); + Self::emit(0x42); } 0xd0 => { scancode_status.arrow_d = false; } 0x4d => { scancode_status.arrow_r = true; - Self::emit(224); - Self::emit(77); + Self::emit(0x1b); + Self::emit(0x5b); + Self::emit(0x43); } 0xcd => { scancode_status.arrow_r = false; @@ -481,7 +494,7 @@ const TYPE1_KEY_CODE_MAPTABLE: [u8; 256] = [ /*0x05*/ b'4', b'$', /*0x06*/ b'5', b'%', /*0x07*/ b'6', b'^', /*0x08*/ b'7', b'&', /*0x09*/ b'8', b'*', /*0x0a*/ b'9', b'(', /*0x0b*/ b'0', b')', /*0x0c*/ b'-', b'_', /*0x0d*/ b'=', b'+', - /*0x0e \b */ 8, 8, // BACKSPACE + /*0x0e \b */ 0x7f, 0x7f, // BACKSPACE /*0x0f*/ b'\t', b'\t', // TAB ////////////////////////character/////////////////////////// /*0x10*/ b'q', b'Q', diff --git a/user/dadk/config/nova_shell-0.1.0.dadk b/user/dadk/config/nova_shell-0.1.0.dadk index ba4b0db9..5b5b79b5 100644 --- a/user/dadk/config/nova_shell-0.1.0.dadk +++ b/user/dadk/config/nova_shell-0.1.0.dadk @@ -6,7 +6,7 @@ "BuildFromSource": { "Git": { "url": "https://git.mirrors.dragonos.org.cn/DragonOS-Community/NovaShell.git", - "revision": "dcf45035c1" + "revision": "6c1ca14da7" } } },