# RFID Keyboard-Wedge Reader

> A .NET component that reconstructs a 4-byte RFID UID from eight hexadecimal keyboard events, handling Turkish Q/F layouts and keeping the per-key path allocation-minimal.

- Author: Muhammet Ali Köker
- Language: en
- Canonical: https://alikoker.com.tr/en/rfid-keyboard-wedge-csharp
- Translation: https://alikoker.com.tr/rfid-keyboard-wedge-csharp
- Published: 2021-07-26T17:57:00+03:00
- Modified: 2026-08-27T10:36:29+03:00
- Verified: 2026-08-27T10:36:29+03:00
- Type: project

Some RFID readers expose no application-specific protocol at all: after reading a card they simply inject eight hexadecimal keystrokes. This repository focuses on that operating-system boundary. It does not implement the RF protocol; it reconstructs the UID from keyboard-wedge events that have already reached Windows.

Turkish Q and F layouts make a naïve `A-F` key assumption unreliable, so the virtual-key-to-nibble mapping is explicit. Each accepted nibble is folded into the numeric value with `partial = (partial << 4) | nibble`, avoiding an intermediate eight-character UID string on the normal key path. Depending on focus and message-routing requirements, the same decoder can be integrated through `KeyDown`, `IMessageFilter`, `WndProc`, or `WH_KEYBOARD_LL`.

The decoded UID remains an identifier, not a credential. A clonable or observable card identifier should not be promoted into an authentication mechanism merely because it arrived through an RFID reader.

Implementation notes: [Reading a 4-Byte RFID UID Through a Keyboard-Wedge/HID Reader in .NET](/en/reading-rfid-keyboard-wedge-hid-dotnet)

GitHub: [GitHub](https://github.com/alikoker/rfid-keyboard-wedge-csharp)  
Zenodo snapshot: [Zenodo](https://zenodo.org/records/22117311)  
DOI: [DOI](https://doi.org/10.5281/zenodo.22117311)

## Cite This Work

Köker, M. A. (2021). RFID Keyboard-Wedge Reader. alikoker.com.tr. https://alikoker.com.tr/en/rfid-keyboard-wedge-csharp

- BibTeX: https://alikoker.com.tr/en/rfid-keyboard-wedge-csharp.bib
- RIS: https://alikoker.com.tr/en/rfid-keyboard-wedge-csharp.ris
- CSL-JSON: https://alikoker.com.tr/en/rfid-keyboard-wedge-csharp.csl.json
