aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/elflink/ldlinux/ldlinux.c8
-rw-r--r--com32/include/console.h1
-rw-r--r--com32/menu/menumain.c5
-rw-r--r--core/include/core.h9
4 files changed, 16 insertions, 7 deletions
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index 76d117c7..e4747d4b 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -297,6 +297,11 @@ void ldlinux_console_init(void)
openconsole(&dev_stdcon_r, &dev_ansiserial_w);
}
+static inline int shift_is_held(void)
+{
+ return !!(kbd_shiftflags() & 0x5d); /* Caps/Scroll/Alt/Shift */
+}
+
__export int main(int argc __unused, char **argv)
{
const void *adv;
@@ -337,8 +342,7 @@ __export int main(int argc __unused, char **argv)
ldlinux_enter_command();
}
- /* TODO: Check KbdFlags? */
- if (!forceprompt)
+ if (!forceprompt && !shift_is_held())
ldlinux_auto_boot();
if (defaultlevel > 1)
diff --git a/com32/include/console.h b/com32/include/console.h
index 74e68f1a..94ffb9fa 100644
--- a/com32/include/console.h
+++ b/com32/include/console.h
@@ -35,6 +35,7 @@
#define _CONSOLE_H
#include <klibc/extern.h>
+#include <inttypes.h>
#include <dev.h>
__extern int openconsole(const struct input_dev *, const struct output_dev *);
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 1d239a7f..b8cb06fd 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -609,11 +609,6 @@ static const char *edit_cmdline(const char *input, int top)
}
}
-static inline int shift_is_held(void)
-{
- return !!(kbd_shiftflags() & 0x5d); /* Caps/Scroll/Alt/Shift */
-}
-
static void print_timeout_message(int tol, int row, const char *msg)
{
static int last_msg_len = 0;
diff --git a/core/include/core.h b/core/include/core.h
index c8689dfd..4783d75f 100644
--- a/core/include/core.h
+++ b/core/include/core.h
@@ -130,6 +130,15 @@ extern void writechr(char data);
extern void crlf(void);
extern int pollchar(void);
extern char getchar(char *hi);
+extern uint8_t kbd_shiftflags(void);
+static inline bool shift_is_held(void)
+{
+ return !!(kbd_shiftflags() & 0x5d); /* Caps/Scroll/Alt/Shift */
+}
+static inline bool ctrl_is_held(void)
+{
+ return !!(kbd_shiftflags() & 0x04); /* Only Ctrl */
+}
extern void cleanup_hardware(void);
extern void sirq_cleanup(void);