[−][src]Module sunrise_keyboard::ps2
PS/2 Keyboard Driver
Allows interacting with an IBM/PC PS/2 Driver. Requires next to no configuration: the user can just call the functions in this module right away.
Required Capabilities
- SVC create_interrupt_event
- SVC wait_synchronization
- IOPort 60
- IOPort 64
- IRQ 1
Structs
| ControlKey | A control key (ctrl, shift, alt, arrows, end, ...) |
| KeyEvent | A KeyEvent is the combination of a key and its state |
| LetterKey | A non-control key (lowercase_ascii, uppercase_ascii) |
| PRIMARY_PS2 | Primary PS2 controller instance on a classical IBM/PC architecture. |
| PS2 | PS2 keyboard state. |
Enums
| Key | A key is either a letter key, a control key, or not attributed |
| State | State of a key on the keyboard. |
Functions
| get_event | Get a ReadableEvent for the PS2 IRQ. Waiting on this event will wait until a keypress is detected. Note that once this event is triggered, it won't trigger again until read_key or try_read_key is called. |
| has_read_key_event | Return true if the PS2 keyboard has an key event to read. |
| read_key | Waits for a single key press, and return its unicode representation. |
| try_read_key | If a key press is pending, return its unicode representation. This can be used to implement poll-based or asynchronous reading from keyboard. |
| try_read_keyboard_state | Return a representation of a single key press if any updates is availaible. |