0.0.2d: Added BGA support, graphics!
This commit is contained in:
@ -61,7 +61,6 @@ int init_keyboard(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
registers_t* keyboard_handler(registers_t* regs)
|
||||
{
|
||||
if (!(inb(PS2_STATUS_PORT) & 1))
|
||||
@ -70,14 +69,78 @@ registers_t* keyboard_handler(registers_t* regs)
|
||||
}
|
||||
|
||||
uint8_t scancode = inb(PS2_DATA_PORT);
|
||||
|
||||
if (scancode & 0x80)
|
||||
|
||||
if (scancode == 0xE0)
|
||||
{
|
||||
extended = true;
|
||||
return regs;
|
||||
}
|
||||
|
||||
bool is_release = scancode & 0x80;
|
||||
uint8_t key = scancode & 0x7F;
|
||||
|
||||
if (extended)
|
||||
{
|
||||
if (is_release)
|
||||
{
|
||||
if (key == 0x1D)
|
||||
{
|
||||
mods &= ~MODIFIER_RCTRL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key == 0x1D)
|
||||
{
|
||||
mods |= MODIFIER_RCTRL;
|
||||
}
|
||||
}
|
||||
|
||||
/* delete key, should add this functionality */
|
||||
/*if (key == 0x53)*/
|
||||
|
||||
extended = false;
|
||||
return regs;
|
||||
}
|
||||
|
||||
if (is_release)
|
||||
{
|
||||
if (key == 0x2A || key == 0x36)
|
||||
{
|
||||
mods &= ~MODIFIER_SHIFT;
|
||||
}
|
||||
|
||||
return regs;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key == 0x2A || key == 0x36)
|
||||
{
|
||||
mods |= MODIFIER_SHIFT;
|
||||
return regs;
|
||||
}
|
||||
else if (key == 0x3A)
|
||||
{
|
||||
mods ^= MODIFIER_CAPS;
|
||||
return regs;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t c = (uint16_t) scancode_map[scancode];
|
||||
|
||||
if (c)
|
||||
{
|
||||
//tty_receive_char(c, mods);
|
||||
char ch = tty_translate_char(c, mods);
|
||||
tty_input_char(tty_get_active(), ch);
|
||||
}
|
||||
|
||||
return regs;
|
||||
}
|
||||
|
||||
|
||||
/* Handle shift press/release */
|
||||
if (scancode == 0x2A || scancode == 0x36)
|
||||
/*if (scancode == 0x2A || scancode == 0x36)
|
||||
{
|
||||
mods |= MODIFIER_SHIFT;
|
||||
return regs;
|
||||
@ -89,9 +152,11 @@ registers_t* keyboard_handler(registers_t* regs)
|
||||
}
|
||||
else if (scancode == 0x3A)
|
||||
{
|
||||
TOGGLE_BIT(mods, 0); /* TOGGLE_BIT defined in types.h, should move elsewhere. */
|
||||
TOGGLE_BIT(mods, 0);
|
||||
return regs;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
/*else if (scancode == 0xE0)
|
||||
{
|
||||
extended = true;
|
||||
@ -127,22 +192,10 @@ registers_t* keyboard_handler(registers_t* regs)
|
||||
return;
|
||||
}*/
|
||||
|
||||
bool release = scancode & 0x80;
|
||||
/*bool release = scancode & 0x80;
|
||||
scancode &= 0x7F;
|
||||
|
||||
if (release)
|
||||
{
|
||||
return regs;
|
||||
}
|
||||
|
||||
uint16_t c = (uint16_t) scancode_map[scancode];
|
||||
|
||||
if (c)
|
||||
{
|
||||
//tty_receive_char(c, mods);
|
||||
char ch = tty_translate_char(c, mods);
|
||||
tty_input_char(tty_get_active(), ch);
|
||||
}
|
||||
|
||||
return regs;
|
||||
}
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user