Skip to content

Instantly share code, notes, and snippets.

View amodm's full-sized avatar

Amod Malviya amodm

View GitHub Profile

On limitations of human interface devices (HIDs)

This post is in response to the WeekendDevPuzzle of 2022-02-12, which has submissions from people who chose to share their perspectives on the puzzle. I'll be linking this post to this Twitter thread, to avoid polluting the original one.

Motivation for today's topic

Every piece of technology gets engineered for a certain set of characteristics, e.g. the vehicle that you use, was designed with a certain typical & max capacity in mind. Same is true for the devices we use to interact with computing systems, be it your workstation, your laptop, or your smartphone. But how often do we reflect on those design characteristics?

Today's puzzle is about throwing some light on these devices, with the hope that it leaves us more informed.

Dissecting the puzzle

@amodm
amodm / test_75.rs
Created August 22, 2023 04:28
test_75.rs
/// created for https://github.com/amodm/webbrowser-rs/issues/75
///
/// Steps:
/// 1. Copy this file as `tests/test_75.rs
/// 2. Run: `RUST_LOG=webbrowser=trace cargo test --test test_75 -- --nocapture`
mod tests {
use webbrowser;
#[test]
fn test_open_default() {
// See the corresponding blog post for details:
// https://amodm.com/blog/2024/07/03/running-a-linux-router-on-macos
import Foundation
// xnu is a custom module that I created to expose the relevant C structs
// that the kernel expects, as those structs are not part of the userspace
// API. This module contains C-bridge headers if-fake.h and if-bridge.h
// which are also shown in this gist.
import xnu