diff options
| author | Tianhao Wang <wth@riseup.net> | 2024-01-30 02:33:26 +0100 |
|---|---|---|
| committer | Tianhao Wang <wth@riseup.net> | 2024-01-30 02:33:26 +0100 |
| commit | 5232a899ca7537a4493a7fbd1bd8e03287ff1e26 (patch) | |
| tree | 87ded44101daa8832ad264996bde74160ab2db93 /src/machine/keyctrl.rs | |
| parent | 553657a0b527ae8ce09ac628da6122fbdd57157b (diff) | |
formatting code, use tab identation -- before it's too late
Diffstat (limited to 'src/machine/keyctrl.rs')
| -rw-r--r-- | src/machine/keyctrl.rs | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/machine/keyctrl.rs b/src/machine/keyctrl.rs index 49ac486..14e7aa4 100644 --- a/src/machine/keyctrl.rs +++ b/src/machine/keyctrl.rs @@ -17,37 +17,37 @@ use crate::arch::x86_64::io_port::*; // set_led(char led,bool on) // set_repeat_rate(int speed,int delay) pub struct KeyboardController { - code: u8, - prefix: u8, - gather: Key, - leds: u8, - - // two ports for keyboard controller - ctrl_port: u16, - data_port: u16, - // status register bits + code: u8, + prefix: u8, + gather: Key, + leds: u8, + + // two ports for keyboard controller + ctrl_port: u16, + data_port: u16, + // status register bits } impl KeyboardController { - - pub fn new() -> Self { - Self { - code: 0, - prefix: 9, - gather: Key::new(), - leds: 0, - ctrl_port: 0x64, - data_port: 0x60, - } - } - - pub fn key_hit(&mut self) -> Key { - // for debugging only - let mut invalid:Key = Key::new(); - invalid.set_raw(0xff); - - let status = inb(self.ctrl_port); - - // TODO here - } + pub fn new() -> Self { + Self { + code: 0, + prefix: 9, + gather: Key::new(), + leds: 0, + ctrl_port: 0x64, + data_port: 0x60, + } + } + + pub fn key_hit(&mut self) -> Key { + todo!(); + // for debugging only + let mut invalid: Key = Key::new(); + invalid.set_raw(0xff); + + let status = inb(self.ctrl_port); + return Key::new(); + // TODO here + } } |
