forked from xamidev/pepperOS
Fix braces + init_paging args
This commit is contained in:
@@ -161,11 +161,9 @@ void keyboard_handler()
|
||||
unsigned char scancode = inb(0x60);
|
||||
|
||||
// Key release (bit 7 set)
|
||||
if (scancode & 0x80)
|
||||
{
|
||||
if (scancode & 0x80) {
|
||||
unsigned char code = scancode & 0x7F;
|
||||
switch (code)
|
||||
{
|
||||
switch (code) {
|
||||
// Clear the corresponding bit if corresponding key is released
|
||||
case LEFT_SHIFT_PRESSED:
|
||||
case RIGHT_SHIFT_PRESSED:
|
||||
@@ -179,12 +177,9 @@ void keyboard_handler()
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// Key press
|
||||
switch (scancode)
|
||||
{
|
||||
switch (scancode) {
|
||||
// Set bits for corresponding special key press
|
||||
case LEFT_SHIFT_PRESSED:
|
||||
case RIGHT_SHIFT_PRESSED:
|
||||
@@ -200,15 +195,12 @@ void keyboard_handler()
|
||||
default:
|
||||
{
|
||||
// Avoiding buffer overflow from extended keys lol
|
||||
if (scancode < 128)
|
||||
{
|
||||
if (scancode < 128) {
|
||||
// Should we get a SHIFTED char or a regular one?
|
||||
unsigned char c = (key_status & SHIFT_PRESSED_BIT) ? keymap_shifted[scancode] : keymap[scancode];
|
||||
|
||||
if (c)
|
||||
{
|
||||
if (c == '\n')
|
||||
{
|
||||
if (c) {
|
||||
if (c == '\n') {
|
||||
_putchar('\r');
|
||||
}
|
||||
// Should probably have a keyboard buffer here... instead of this
|
||||
@@ -225,8 +217,7 @@ void keyboard_init(unsigned char layout)
|
||||
// Here we might go and select PS/2, USB, or other... (once we implement multiple keyboard protocols)
|
||||
|
||||
// Keyboard layout selection
|
||||
switch (layout)
|
||||
{
|
||||
switch (layout) {
|
||||
case US:
|
||||
keymap = kbdus;
|
||||
keymap_shifted = kbdus_shifted;
|
||||
@@ -242,8 +233,7 @@ void keyboard_init(unsigned char layout)
|
||||
}
|
||||
|
||||
// Flush keyboard buffer
|
||||
while (inb(0x64) & 1)
|
||||
{
|
||||
while (inb(0x64) & 1) {
|
||||
inb(0x60);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user