Skip to content

Commit 8165f52

Browse files
authored
Fix typos in keyboard driver chapters (#116)
* fix(architecture): typo in "Add Keyboard Support" * fix(architecture): `SHIFT_MASK` instead of `CTRL_MASK` in chapter 17
1 parent d61927d commit 8165f52

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

02_Architecture/09_Add_Keyboard_Support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Whenever a key is pressed or released the keyboard sends some data to us via the
2121

2222
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.
2323

24-
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.
24+
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.
2525

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

02_Architecture/11_Keyboard_Driver_Implementation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ char shifted_chars[] = {
272272

273273
char get_printable_char(key_event key)
274274
{
275-
if (key.status_mask & CTRL_MASK || key.caps_lock)
275+
if (key.status_mask & SHIFT_MASK || key.caps_lock)
276276
return shifted_chars[key.code];
277277
else
278278
return lower_chars[key.code];
@@ -288,7 +288,7 @@ Using the switch statement approach looks like the following:
288288
```c
289289
char get_printable_char(key_event key)
290290
{
291-
const bool shifted = key.status_mask & CTRL_MASK || key.caps_lock;
291+
const bool shifted = key.status_mask & SHIFT_MASK || key.caps_lock;
292292
switch (key.code)
293293
{
294294
case KEY_A:

0 commit comments

Comments
 (0)