From 786f0456666788716ad1198843c28f5dae2cb8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 29 Dec 2020 18:31:30 +0100 Subject: [PATCH] BootManager: add support for page down/up/home/end keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Page down is the same as the end key, and just selects the last entry in the boot menu. * Likewise, page up is the same as the home key. Change-Id: Ibaf8559b0f68462834395aaec8fb22554d7a90f6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3555 Reviewed-by: John Scipione Reviewed-by: Jérôme Duval --- src/apps/bootmanager/bootman.S | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/apps/bootmanager/bootman.S b/src/apps/bootmanager/bootman.S index b296035844..b586d1fc51 100644 --- a/src/apps/bootmanager/bootman.S +++ b/src/apps/bootmanager/bootman.S @@ -134,6 +134,10 @@ ; Key codes %assign KEY_DOWN 0x50 %assign KEY_UP 0x48 +%assign KEY_PAGE_DOWN 0x51 +%assign KEY_PAGE_UP 0x49 +%assign KEY_HOME 0x47 +%assign KEY_END 0x4f %assign KEY_RETURN 0x1C ; Modifier key bitmasks @@ -431,9 +435,19 @@ inputLoop: cmp ah, KEY_DOWN je selectNextPartition + cmp ah, KEY_PAGE_DOWN + je selectLastPartition + cmp ah, KEY_END + je selectLastPartition + cmp ah, KEY_UP je selectPreviousPartition + cmp ah, KEY_PAGE_UP + je selectFirstPartition + cmp ah, KEY_HOME + je selectFirstPartition + cmp ah, KEY_RETURN jne inputLoop jmp bootSelectedPartition @@ -448,6 +462,12 @@ selectNextPartition: mov [bp + selection], ax jmp mainLoop +selectLastPartition: + mov ax, [listItemCount] + dec ax + mov [bp + selection], ax + jmp mainLoop + selectPreviousPartition: mov ax, [bp + selection] or ax, ax @@ -458,6 +478,11 @@ selectPreviousPartition: mov [bp + selection], ax jmp mainLoop +selectFirstPartition: + xor ax, ax + mov [bp + selection], ax + jmp mainLoop + ; ======================= Print the OS list ============================ printMenu: