aboutsummaryrefslogtreecommitdiff
path: root/src/machine/keyctrl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine/keyctrl.rs')
-rw-r--r--src/machine/keyctrl.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/machine/keyctrl.rs b/src/machine/keyctrl.rs
index 349f4ff..dc3402d 100644
--- a/src/machine/keyctrl.rs
+++ b/src/machine/keyctrl.rs
@@ -186,6 +186,10 @@ impl KeyboardController {
// this should be called by the interrupt handler prologue
pub fn fetch_key(&mut self) {
+ // mask keyboard interrupts when polling.
+ let was_masked = Self::is_int_masked();
+ if !was_masked {Self::disable_keyboard_int();}
+
// I'd like to see if this panics....
let sr = self.read_status().unwrap();
// ignore mouse events
@@ -193,6 +197,7 @@ impl KeyboardController {
return;
}
self.update_state(self.dport.inb());
+ if !was_masked {Self::enable_keyboard_int();}
}
// this should be called by the "epilogue"