mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
console: don't accept new input events if locked
This commit is contained in:
@@ -53,6 +53,9 @@ size_t console_write(char *str, size_t count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void console_process_events(input_event_t *events, int count) {
|
void console_process_events(input_event_t *events, int count) {
|
||||||
|
if (__atomic_load_n(&locked, __ATOMIC_RELAXED))
|
||||||
|
return;
|
||||||
|
|
||||||
long ipl = spinlock_acquire_raise_ipl(&input_buffer_lock, IPL_INPUT);
|
long ipl = spinlock_acquire_raise_ipl(&input_buffer_lock, IPL_INPUT);
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
if (events[i].type != INPUT_EV_KEY || events[i].code >= INPUT_KEY_BTN_LEFT)
|
if (events[i].type != INPUT_EV_KEY || events[i].code >= INPUT_KEY_BTN_LEFT)
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
name=astral
|
name=astral
|
||||||
revision=16
|
revision=17
|
||||||
from_source=astral
|
from_source=astral
|
||||||
imagedeps="build-essential nasm"
|
imagedeps="build-essential nasm"
|
||||||
hostdeps="xgcc xbinutils limine"
|
hostdeps="xgcc xbinutils limine"
|
||||||
|
|||||||
Reference in New Issue
Block a user