Hi!
Was wondering if it could be possible to have/add keyboard functions in ipxe's build in menu system.
Like, "backspace" to go back, instead of having an menu entry "back/prev", with "goto prev_stage".
Makes any sense?
Torgeir
(2013-01-04 09:00)Torgeir Wrote: [ -> ]Was wondering if it could be possible to have/add keyboard functions in ipxe's build in menu system.
Like, "backspace" to go back, instead of having an menu entry "back/prev", with "goto prev_stage".
There's no concept of "back/prev" built in to the menu system; it doesn't retain state between menus.
The best way to achieve what you want is probably to include a "back/prev" entry in each of your menus, with the shortcut key set to backspace.
Michael
The concept of shortcut keys is working perfectly
But I cannot get the code for backspace to work. Using the key "b" for testing, works as intended.
For backspace I've tried (both entries):
#define BACKSPACE CTRL_H
#define KEY_BACKSPACE BACKSPACE
Backspace in lowercase.
All examples.
Code:
item --key BACKSPACE prev_stage * Prev
item --key CTRL_H prev_stage * Prev
item --key KEY_BACKSPACE prev_stage * Prev
item --key backspace prev_stage * Prev
Am I missing something?
Torgeir
Nevermind. Found it:
Quote:# grep -R "BACKSPACE" *
hci/editstring.c: case KEY_BACKSPACE:
hci/mucurses/kb.c: case KEY_BACKSPACE :
hci/mucurses/kb.c: case KEY_BACKSPACE :
include/ipxe/efi/Protocol/SimpleTextIn.h:#define CHAR_BACKSPACE 0x0008
include/ipxe/keys.h:#define BACKSPACE CTRL_H
include/ipxe/keys.h:#define KEY_BACKSPACE BACKSPACE
interface/linux/linux_console.c: return KEY_BACKSPACE;
Torgeir
(2013-01-04 09:54)Torgeir Wrote: [ -> ]The concept of shortcut keys is working perfectly
But I cannot get the code for backspace to work. Using the key "b" for testing, works as intended.
As I think you already figured out, you need to use the literal value for backspace (0x08):
Code:
item --key 0x08 prev_stage * Prev
Michael