input

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type I8042

type I8042 struct {
	// contains filtered or unexported fields
}

I8042 implements the i8042 keyboard controller.

func NewI8042

func NewI8042() *I8042

NewI8042 creates a new i8042 controller.

func (*I8042) IOPorts

func (c *I8042) IOPorts() []uint16

IOPorts implements hv.X86IOPortDevice (legacy support).

func (*I8042) Init

func (c *I8042) Init(vm hv.VirtualMachine) error

Init implements hv.Device.

func (*I8042) QueueKeyboardData

func (c *I8042) QueueKeyboardData(data byte)

QueueKeyboardData queues data from the keyboard to the output buffer.

func (*I8042) QueueKeyboardDataLocked

func (c *I8042) QueueKeyboardDataLocked(data byte)

QueueKeyboardDataLocked queues data from the keyboard (must be called with mutex held).

func (*I8042) QueueMouseData

func (c *I8042) QueueMouseData(data byte)

QueueMouseData queues data from the mouse to the output buffer.

func (*I8042) ReadIOPort

func (c *I8042) ReadIOPort(ctx hv.ExitContext, port uint16, data []byte) error

ReadIOPort implements chipset.PortIOHandler.

func (*I8042) Reset

func (c *I8042) Reset() error

Reset implements chipset.ChangeDeviceState.

func (*I8042) SetKeyboardIRQ

func (c *I8042) SetKeyboardIRQ(line chipset.LineInterrupt)

SetKeyboardIRQ sets the interrupt line for keyboard (IRQ1).

func (*I8042) SetKeyboardIRQFromFunc

func (c *I8042) SetKeyboardIRQFromFunc(fn func(bool))

SetKeyboardIRQFromFunc sets the keyboard IRQ using a function adapter.

func (*I8042) SetMouseIRQ

func (c *I8042) SetMouseIRQ(line chipset.LineInterrupt)

SetMouseIRQ sets the interrupt line for mouse (IRQ12).

func (*I8042) Start

func (c *I8042) Start() error

Start implements chipset.ChangeDeviceState.

func (*I8042) Stop

func (c *I8042) Stop() error

Stop implements chipset.ChangeDeviceState.

func (*I8042) SupportsMmio

func (c *I8042) SupportsMmio() *chipset.MmioIntercept

SupportsMmio implements chipset.ChipsetDevice.

func (*I8042) SupportsPollDevice

func (c *I8042) SupportsPollDevice() *chipset.PollDevice

SupportsPollDevice implements chipset.ChipsetDevice.

func (*I8042) SupportsPortIO

func (c *I8042) SupportsPortIO() *chipset.PortIOIntercept

SupportsPortIO implements chipset.ChipsetDevice.

func (*I8042) WriteIOPort

func (c *I8042) WriteIOPort(ctx hv.ExitContext, port uint16, data []byte) error

WriteIOPort implements chipset.PortIOHandler.

type OutputBufferState

type OutputBufferState uint8

OutputBufferState tracks what device owns the output buffer

const (
	OutputBufferEmpty OutputBufferState = iota
	OutputBufferController
	OutputBufferKeyboard
	OutputBufferMouse
)

type PS2Keyboard

type PS2Keyboard struct {
	// contains filtered or unexported fields
}

PS2Keyboard implements a PS/2 keyboard device.

func NewPS2Keyboard

func NewPS2Keyboard() *PS2Keyboard

NewPS2Keyboard creates a new PS/2 keyboard device.

func (*PS2Keyboard) HandleCommand

func (k *PS2Keyboard) HandleCommand(cmd byte) error

HandleCommand processes a command sent to the keyboard.

func (*PS2Keyboard) Reset

func (k *PS2Keyboard) Reset()

Reset resets the keyboard to default state.

func (*PS2Keyboard) SendKey

func (k *PS2Keyboard) SendKey(scancode byte, pressed bool)

SendKey sends a key press/release event to the keyboard.

func (*PS2Keyboard) SetController

func (k *PS2Keyboard) SetController(ctrl *I8042)

SetController sets the i8042 controller this keyboard belongs to.

func (*PS2Keyboard) SetIRQ

func (k *PS2Keyboard) SetIRQ(line chipset.LineInterrupt)

SetIRQ sets the interrupt line for this keyboard.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL