This should be enough for keyboard handling.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23211 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3e4c56176d
commit
fa806b5473
@ -10,26 +10,15 @@
|
||||
#include <boot/platform.h>
|
||||
|
||||
|
||||
static uint16
|
||||
static uint32
|
||||
check_for_key(void)
|
||||
{
|
||||
//XXX: non blocking in ?
|
||||
#if 0
|
||||
bios_regs regs;
|
||||
regs.eax = 0x0100;
|
||||
call_bios(0x16, ®s);
|
||||
|
||||
// the zero flag is set when there is no key stroke waiting for us
|
||||
if (regs.flags & ZERO_FLAG)
|
||||
union key k;
|
||||
if (Bconstat(DEV_CON) == 0)
|
||||
return 0;
|
||||
|
||||
// remove the key from the buffer
|
||||
regs.eax = 0;
|
||||
call_bios(0x16, ®s);
|
||||
|
||||
return regs.eax & 0xffff;
|
||||
#endif
|
||||
return 0;
|
||||
k.d0 = Bconin(DEV_CON);
|
||||
return k.d0;
|
||||
}
|
||||
|
||||
|
||||
@ -45,7 +34,7 @@ extern "C" union key
|
||||
wait_for_key(void)
|
||||
{
|
||||
union key key;
|
||||
key.d0 = Bconin(2);
|
||||
key.d0 = Bconin(DEV_CON);
|
||||
|
||||
return key;
|
||||
}
|
||||
@ -57,7 +46,7 @@ check_for_boot_keys(void)
|
||||
union key key;
|
||||
uint32 options = 0;
|
||||
|
||||
while ((key.ax = check_for_key()) != 0) {
|
||||
while ((key.d0 = check_for_key()) != 0) {
|
||||
switch (key.code.ascii) {
|
||||
case ' ':
|
||||
options |= BOOT_OPTION_MENU;
|
||||
|
@ -8,8 +8,10 @@
|
||||
union key {
|
||||
uint32 d0;
|
||||
struct {
|
||||
uint16 bios; // scan code
|
||||
uint16 ascii;
|
||||
uint8 modifiers; // not always present!
|
||||
uint8 bios; // scan code
|
||||
uint8 dummy;
|
||||
uint8 ascii;
|
||||
} code;
|
||||
};
|
||||
|
||||
|
@ -16,6 +16,7 @@ extern "C" {
|
||||
#define DEV_PRINTER 0
|
||||
#define DEV_AUX 1
|
||||
#define DEV_CON 2
|
||||
#define DEV_CONSOLE 2
|
||||
#define DEV_MIDI 3
|
||||
#define DEV_IKBD 4
|
||||
#define DEV_RAW 5
|
||||
|
Loading…
Reference in New Issue
Block a user