[PR #312] [CLOSED] ui: add optional keystroke logging for keyboard events #435

Open
opened 2026-01-31 21:31:16 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/qemu/qemu/pull/312
Author: @tsmartt
Created: 11/26/2025
Status: Closed

Base: masterHead: ts/feat/playing-around-keylogger


📝 Commits (1)

  • 9e54ff9 ui: add optional keystroke logging for keyboard events

📊 Changes

1 file changed (+44 additions, -5 deletions)

View changed files

📝 ui/kbd-state.c (+44 -5)

📄 Description

To see characters echoed in the UEFI shell, launch with USB keyboard on XHCI (and logging still works):

export QEMU_KEYLOG_PATH="$PWD/keystrokes.log"
./build/qemu-system-aarch64-unsigned
-M virt -cpu cortex-a72 -m 512M
-display cocoa
-device virtio-gpu-pci
-device qemu-xhci
-device usb-kbd
-device usb-mouse
-monitor none
-serial null
-drive if=pflash,format=raw,readonly=on,file=build/pc-bios/edk2-aarch64-code.fd
-drive if=pflash,format=raw,file=build/pc-bios/edk2-arm-vars.fd

Build steps used on macOS M1:

  • Install deps: brew install pkg-config meson ninja glib pixman libslirp dtc sdl2 gnutls.
  • From repo root: rm -rf build && mkdir build.
  • Configure for aarch64 with Cocoa/slirp (DTC include/lib set for Homebrew):

cd build
CFLAGS='-I/opt/homebrew/opt/dtc/include'
LDFLAGS='-L/opt/homebrew/opt/dtc/lib'
PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig
../configure --target-list=aarch64-softmmu --enable-cocoa --enable-slirp --disable-werror

  • Build: ninja (or ninja -C build from repo root).
  • Binary to run: build/qemu-system-aarch64-unsigned.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/qemu/qemu/pull/312 **Author:** [@tsmartt](https://github.com/tsmartt) **Created:** 11/26/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `ts/feat/playing-around-keylogger` --- ### 📝 Commits (1) - [`9e54ff9`](https://github.com/qemu/qemu/commit/9e54ff92b527235fbe1201823a5730f018a8dcf6) ui: add optional keystroke logging for keyboard events ### 📊 Changes **1 file changed** (+44 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `ui/kbd-state.c` (+44 -5) </details> ### 📄 Description To see characters echoed in the UEFI shell, launch with USB keyboard on XHCI (and logging still works): export QEMU_KEYLOG_PATH="$PWD/keystrokes.log" ./build/qemu-system-aarch64-unsigned \ -M virt -cpu cortex-a72 -m 512M \ -display cocoa \ -device virtio-gpu-pci \ -device qemu-xhci \ -device usb-kbd \ -device usb-mouse \ -monitor none \ -serial null \ -drive if=pflash,format=raw,readonly=on,file=build/pc-bios/edk2-aarch64-code.fd \ -drive if=pflash,format=raw,file=build/pc-bios/edk2-arm-vars.fd Build steps used on macOS M1: - Install deps: brew install pkg-config meson ninja glib pixman libslirp dtc sdl2 gnutls. - From repo root: rm -rf build && mkdir build. - Configure for aarch64 with Cocoa/slirp (DTC include/lib set for Homebrew): cd build CFLAGS='-I/opt/homebrew/opt/dtc/include' \ LDFLAGS='-L/opt/homebrew/opt/dtc/lib' \ PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig \ ../configure --target-list=aarch64-softmmu --enable-cocoa --enable-slirp --disable-werror - Build: ninja (or ninja -C build from repo root). - Binary to run: build/qemu-system-aarch64-unsigned. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 21:31:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/qemu#435