A C# utility for extracting and exporting Windows keyboard layouts to multiple formats, including QMK-compatible header files. This tool helps keyboard firmware developers and enthusiasts to accurately replicate Windows keyboard layouts in their custom keyboard projects.
- 🔍 Extracts keyboard layouts directly from Windows Registry
- 🗺️ Maps virtual keys and character combinations
- ⚡ Identifies and exports dead key configurations
- 💾 Exports layouts in multiple formats:
- JSON format for further processing
- QMK-compatible header files for firmware development
- ⌨️ Supports all installed keyboard layouts
- 🔄 Handles shift states and special characters
- Windows operating system
- .NET Framework (compatible with the C# version you're using)
- Administrative privileges (for registry access)
- Clone the repository:
- Open the solution in Visual Studio or your preferred C# IDE
- Build the project
- Run the executable:
KeyboardLayoutExtractor.exe
- The program will automatically:
- Scan your system for installed keyboard layouts
- Extract layout information
- Generate files in the
exported_layouts
directory
The tool generates two types of files for each keyboard layout:
-
{LayoutId}.json
- Contains complete layout data including:- Layout identification information
- Virtual key mappings
- Character mappings
- Dead keys list
-
keymap_{layoutid}.h
- QMK-compatible header file containing:- Layout definitions
- Virtual key mappings
- Dead key definitions
- Uses Windows API (user32.dll) for keyboard layout interaction
- Registry access for layout enumeration
- Virtual key mapping and character code conversion
- Dead key detection and processing
GetKeyboardLayoutList
LoadKeyboardLayout
VkKeyScanEx
MapVirtualKeyEx
ToUnicodeEx
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.
- Follow existing code style and conventions
- Add comments for complex operations
- Update documentation for new features
- Include appropriate error handling
This project is licensed under the MIT License - see the LICENSE file for details.
- Windows API documentation
- QMK Firmware project for keyboard mapping standards
This program requires registry access to read keyboard layout information. Make sure to run it with appropriate permissions.
-
Access Denied
- Run the program with administrative privileges
- Check Windows security settings
-
Missing Layouts
- Verify layouts are properly installed in Windows
- Check registry permissions
When reporting issues, please include:
- Windows version
- Installed keyboard layouts
- Any error messages
- Generated output files
KeyboardLayoutExtractor/
├── Program.cs # Main program logic
├── exported_layouts/ # Generated output directory
│ ├── *.json # Layout data in JSON format
│ └── keymap_*.h # QMK-compatible header files
└── README.md # This file