Let's cache the scancodes and flush them at the end. Also make sure to send only as many as the driver can send correctly. It's important here to chunk the scancodes correctly, so that we don't accidentally split them over successive calls to the driver
12 lines
350 B
Go
12 lines
350 B
Go
package bootcommand
|
|
|
|
const shiftedChars = "~!@#$%^&*()_+{}|:\"<>?"
|
|
|
|
// BCDriver is our access to the VM we want to type boot commands to
|
|
type BCDriver interface {
|
|
SendKey(key rune, action KeyAction) error
|
|
SendSpecial(special string, action KeyAction) error
|
|
// Finalize will be called after every expression has been processed.
|
|
Finalize() error
|
|
}
|