Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 02_Architecture/09_Add_Keyboard_Support.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Whenever a key is pressed or released the keyboard sends some data to us via the

There are three different sets of scancodes available (1, 2 and 3). Sets 1 and 2 are the most widely supported, set 3 was a later addition and is rare to see in the wild. Set 1 was the first, and a lot of software at the time was hardcoded to support it. This prevented an interesting problem when set 2 was introduced later on, and then standardized as being the default set for a keyboard. The solution was to keep set 2 as the default, but the ps/2 controller will translate set 2 scancodes into set 1 scancodes. To ensure compatability with older software, and confuse future os developers, this feature is enabled by default.

The scancode that is generated when a key is pressed is called the **make** code, while the scancode generated by a key release is callee the **break** code.
The scancode that is generated when a key is pressed is called the **make** code, while the scancode generated by a key release is called the **break** code.

In order to develop our keyboard driver we'll need to do the following:

Expand Down
4 changes: 2 additions & 2 deletions 02_Architecture/11_Keyboard_Driver_Implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ char shifted_chars[] = {

char get_printable_char(key_event key)
{
if (key.status_mask & CTRL_MASK || key.caps_lock)
if (key.status_mask & SHIFT_MASK || key.caps_lock)
return shifted_chars[key.code];
else
return lower_chars[key.code];
Expand All @@ -288,7 +288,7 @@ Using the switch statement approach looks like the following:
```c
char get_printable_char(key_event key)
{
const bool shifted = key.status_mask & CTRL_MASK || key.caps_lock;
const bool shifted = key.status_mask & SHIFT_MASK || key.caps_lock;
switch (key.code)
{
case KEY_A:
Expand Down