From 2634bb2d37a6f053608bc4d51042a9a71db6240a Mon Sep 17 00:00:00 2001 From: Ryan Kennedy Date: Sat, 22 Feb 2020 18:55:21 -0600 Subject: [PATCH 1/3] Updated pc-keyboard to `0.5.0` --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/interrupts.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1066076e..b96e1270 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,9 +73,9 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "pc-keyboard" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff50ab09ba31bcebc0669f4e64c0952fae1acdca9e6e0587e68e4e8443808ac" +checksum = "c48392db76c4e9a69e0b3be356c5f97ebb7b14413c5e4fd0af4755dbf86e2fce" [[package]] name = "pic8259_simple" diff --git a/Cargo.toml b/Cargo.toml index cc7e49e2..685e6662 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ spin = "0.5.2" x86_64 = "0.8.1" uart_16550 = "0.2.0" pic8259_simple = "0.1.1" -pc-keyboard = "0.3.1" +pc-keyboard = "0.5.0" [dependencies.lazy_static] version = "1.0" diff --git a/src/interrupts.rs b/src/interrupts.rs index 025eec43..cd6aa741 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -66,13 +66,13 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: &mut InterruptSt } extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut InterruptStackFrame) { - use pc_keyboard::{layouts, DecodedKey, Keyboard, ScancodeSet1}; + use pc_keyboard::{layouts, DecodedKey, HandleControl, Keyboard, ScancodeSet1}; use spin::Mutex; use x86_64::instructions::port::Port; lazy_static! { static ref KEYBOARD: Mutex> = - Mutex::new(Keyboard::new(layouts::Us104Key, ScancodeSet1)); + Mutex::new(Keyboard::new(layouts::Us104Key, ScancodeSet1, HandleControl::MapLettersToUnicode)); } let mut keyboard = KEYBOARD.lock(); From 2a8f499f7357b54ec35b6c5d9d20f917c17af31b Mon Sep 17 00:00:00 2001 From: Ryan Kennedy Date: Sat, 22 Feb 2020 19:02:57 -0600 Subject: [PATCH 2/3] Might help if I use cargo fmt --- src/interrupts.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interrupts.rs b/src/interrupts.rs index cd6aa741..a5083f77 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -72,7 +72,11 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut Interrup lazy_static! { static ref KEYBOARD: Mutex> = - Mutex::new(Keyboard::new(layouts::Us104Key, ScancodeSet1, HandleControl::MapLettersToUnicode)); + Mutex::new(Keyboard::new( + layouts::Us104Key, + ScancodeSet1, + HandleControl::MapLettersToUnicode + )); } let mut keyboard = KEYBOARD.lock(); From de509e058fe1e970f3827577cb8b3a447fdcceba Mon Sep 17 00:00:00 2001 From: Ryan Kennedy Date: Tue, 25 Feb 2020 10:32:39 -0600 Subject: [PATCH 3/3] Switched to HandleControl::Ignore --- src/interrupts.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/interrupts.rs b/src/interrupts.rs index a5083f77..ceb82cd1 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -71,12 +71,9 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut Interrup use x86_64::instructions::port::Port; lazy_static! { - static ref KEYBOARD: Mutex> = - Mutex::new(Keyboard::new( - layouts::Us104Key, - ScancodeSet1, - HandleControl::MapLettersToUnicode - )); + static ref KEYBOARD: Mutex> = Mutex::new( + Keyboard::new(layouts::Us104Key, ScancodeSet1, HandleControl::Ignore) + ); } let mut keyboard = KEYBOARD.lock();