feat(pointer): virtio tablet as 2nd input dev (driver per-instance VAs, abs/btn decode), input server serves 2 devices on one notif; display software cursor, bar click switches window, presses/releases to front window in its px; k-ui hit-tests (press focuses, release on same presses, field only focuses)

This commit is contained in:
2026-10-28 16:50:20 +01:00
parent 0de13f124d
commit 1401af3d82
22 changed files with 545 additions and 46 deletions

View File

@@ -20,6 +20,8 @@ pub struct Devices {
pub disk: Device,
pub gpu: Device,
pub input: Device,
/// A second input device: a tablet (the pointer), if the board has one.
pub pointer: Device,
/// The gatekeeper's: a small disk of its own for the key slots.
pub keystore: Device,
pub random: Device,
@@ -94,6 +96,7 @@ pub fn discover() -> Devices {
disk: Device::NONE,
gpu: Device::NONE,
input: Device::NONE,
pointer: Device::NONE,
keystore: Device::NONE,
random: Device::NONE,
};
@@ -109,6 +112,8 @@ pub fn discover() -> Devices {
(DEVICE_ID_BLOCK, size) if size <= KEYSTORE_MAX_SECTORS => &mut found.keystore,
(DEVICE_ID_BLOCK, _) => &mut found.disk,
(DEVICE_ID_GPU, _) => &mut found.gpu,
// The first is the keyboard, the next the pointer.
(DEVICE_ID_INPUT, _) if found.input.mmio.is_some() => &mut found.pointer,
(DEVICE_ID_INPUT, _) => &mut found.input,
(DEVICE_ID_RNG, _) => &mut found.random,
_ => continue,

View File

@@ -244,7 +244,12 @@ impl<'a> Launcher<'a> {
Device::Keystore => (self.devices.keystore, ", keystore handed over", ", no keystore"),
Device::Random => (self.devices.random, ", randomness handed over", ", no randomness"),
};
match libkos::device::give_device(ep, dev).is_ok() && dev.mmio.is_some() {
let handed = libkos::device::give_device(ep, dev).is_ok() && dev.mmio.is_some();
// The input server takes a pointer after the keyboard, or none.
if device == Device::Input {
let _ = libkos::device::give_device(ep, self.devices.pointer);
}
match handed {
true => given,
false => none,
}