mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-21 18:44:01 +00:00
试图修复bug但没成功+CLeonOS Wine
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <clks/exec.h>
|
||||
#include <clks/keyboard.h>
|
||||
#include <clks/log.h>
|
||||
#include <clks/shell.h>
|
||||
@@ -105,6 +106,18 @@ static clks_bool clks_keyboard_shell_input_enabled(void) {
|
||||
return (clks_tty_active() == 0U) ? CLKS_TRUE : CLKS_FALSE;
|
||||
}
|
||||
|
||||
static clks_bool clks_keyboard_should_pump_shell_now(void) {
|
||||
if (clks_keyboard_shell_input_enabled() == CLKS_FALSE) {
|
||||
return CLKS_FALSE;
|
||||
}
|
||||
|
||||
if (clks_exec_is_running() == CLKS_TRUE) {
|
||||
return CLKS_FALSE;
|
||||
}
|
||||
|
||||
return CLKS_TRUE;
|
||||
}
|
||||
|
||||
static char clks_keyboard_translate_scancode(u8 code) {
|
||||
clks_bool shift_active = (clks_kbd_lshift_down == CLKS_TRUE || clks_kbd_rshift_down == CLKS_TRUE)
|
||||
? CLKS_TRUE
|
||||
@@ -174,7 +187,9 @@ void clks_keyboard_handle_scancode(u8 scancode) {
|
||||
clks_kbd_e0_prefix = CLKS_FALSE;
|
||||
|
||||
if (ext != '\0' && clks_keyboard_shell_input_enabled() == CLKS_TRUE) {
|
||||
(void)clks_keyboard_queue_push(ext);
|
||||
if (clks_keyboard_queue_push(ext) == CLKS_TRUE && clks_keyboard_should_pump_shell_now() == CLKS_TRUE) {
|
||||
clks_shell_pump_input(1U);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -202,7 +217,9 @@ void clks_keyboard_handle_scancode(u8 scancode) {
|
||||
char translated = clks_keyboard_translate_scancode(code);
|
||||
|
||||
if (translated != '\0' && clks_keyboard_shell_input_enabled() == CLKS_TRUE) {
|
||||
(void)clks_keyboard_queue_push(translated);
|
||||
if (clks_keyboard_queue_push(translated) == CLKS_TRUE && clks_keyboard_should_pump_shell_now() == CLKS_TRUE) {
|
||||
clks_shell_pump_input(1U);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user