fix(kbd): 修复键盘命令解析器生成的字节码与Linux不一致的问题 (#946)

Signed-off-by: longjin <longjin@dragonos.org>
This commit is contained in:
LoGin 2024-09-29 03:15:21 +08:00 committed by GitHub
parent 920bda5958
commit 047dbfd44b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 11 deletions

View File

@ -176,6 +176,9 @@ impl TypeOneFSMState {
} }
0x47 => { 0x47 => {
scancode_status.home = true; scancode_status.home = true;
Self::emit(0x1b);
Self::emit(0x5b);
Self::emit(0x48);
} }
0xc7 => { 0xc7 => {
scancode_status.home = false; scancode_status.home = false;
@ -188,13 +191,19 @@ impl TypeOneFSMState {
} }
0x53 => { 0x53 => {
scancode_status.del = true; scancode_status.del = true;
Self::emit(127); Self::emit(0x1b);
Self::emit(0x5b);
Self::emit(0x33);
Self::emit(0x7e);
} }
0xd3 => { 0xd3 => {
scancode_status.del = false; scancode_status.del = false;
} }
0x4f => { 0x4f => {
scancode_status.end = true; scancode_status.end = true;
Self::emit(0x1b);
Self::emit(0x5b);
Self::emit(0x46);
} }
0xcf => { 0xcf => {
scancode_status.end = false; scancode_status.end = false;
@ -207,32 +216,36 @@ impl TypeOneFSMState {
} }
0x48 => { 0x48 => {
scancode_status.arrow_u = true; scancode_status.arrow_u = true;
Self::emit(224); Self::emit(0x1b);
Self::emit(72); Self::emit(0x5b);
Self::emit(0x41);
} }
0xc8 => { 0xc8 => {
scancode_status.arrow_u = false; scancode_status.arrow_u = false;
} }
0x4b => { 0x4b => {
scancode_status.arrow_l = true; scancode_status.arrow_l = true;
Self::emit(224); Self::emit(0x1b);
Self::emit(75); Self::emit(0x5b);
Self::emit(0x44);
} }
0xcb => { 0xcb => {
scancode_status.arrow_l = false; scancode_status.arrow_l = false;
} }
0x50 => { 0x50 => {
scancode_status.arrow_d = true; scancode_status.arrow_d = true;
Self::emit(224); Self::emit(0x1b);
Self::emit(80); Self::emit(0x5b);
Self::emit(0x42);
} }
0xd0 => { 0xd0 => {
scancode_status.arrow_d = false; scancode_status.arrow_d = false;
} }
0x4d => { 0x4d => {
scancode_status.arrow_r = true; scancode_status.arrow_r = true;
Self::emit(224); Self::emit(0x1b);
Self::emit(77); Self::emit(0x5b);
Self::emit(0x43);
} }
0xcd => { 0xcd => {
scancode_status.arrow_r = false; 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'^', /*0x05*/ b'4', b'$', /*0x06*/ b'5', b'%', /*0x07*/ b'6', b'^',
/*0x08*/ b'7', b'&', /*0x09*/ b'8', b'*', /*0x0a*/ b'9', b'(', /*0x08*/ b'7', b'&', /*0x09*/ b'8', b'*', /*0x0a*/ b'9', b'(',
/*0x0b*/ b'0', b')', /*0x0c*/ b'-', b'_', /*0x0d*/ b'=', 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 /*0x0f*/ b'\t', b'\t', // TAB
////////////////////////character/////////////////////////// ////////////////////////character///////////////////////////
/*0x10*/ b'q', b'Q', /*0x10*/ b'q', b'Q',

View File

@ -6,7 +6,7 @@
"BuildFromSource": { "BuildFromSource": {
"Git": { "Git": {
"url": "https://git.mirrors.dragonos.org.cn/DragonOS-Community/NovaShell.git", "url": "https://git.mirrors.dragonos.org.cn/DragonOS-Community/NovaShell.git",
"revision": "dcf45035c1" "revision": "6c1ca14da7"
} }
} }
}, },