{"id":19527821,"url":"https://github.com/valinet/xps15kbfix","last_synced_at":"2025-04-26T11:32:17.809Z","repository":{"id":108971771,"uuid":"400604414","full_name":"valinet/xps15kbfix","owner":"valinet","description":"WDF-based keyboard filter kernel-mode driver based on the sample from Microsoft that is able to remap keys for each individual keyboard connected to the PC.","archived":false,"fork":false,"pushed_at":"2024-06-23T20:03:07.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-24T08:49:04.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valinet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-27T18:40:53.000Z","updated_at":"2024-06-23T20:03:26.000Z","dependencies_parsed_at":"2023-04-07T11:30:51.860Z","dependency_job_id":null,"html_url":"https://github.com/valinet/xps15kbfix","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valinet%2Fxps15kbfix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valinet%2Fxps15kbfix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valinet%2Fxps15kbfix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valinet%2Fxps15kbfix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valinet","download_url":"https://codeload.github.com/valinet/xps15kbfix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224032125,"owners_count":17244373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T01:16:29.856Z","updated_at":"2024-11-11T01:16:30.750Z","avatar_url":"https://github.com/valinet.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kbfiltr\n\nWDF-based keyboard filter kernel-mode driver based on the [sample from Microsoft](https://docs.microsoft.com/en-us/samples/microsoft/windows-driver-samples/keyboard-input-wdf-filter-driver-kbfiltr/) that is able to remap keys for each individual keyboard connected to the PC. There are no settings - edit [the source code](https://github.com/valinet/xps15kbfix/blob/a9b39ecce7d07f6e3a01456481f376afd33538cd/sys/kbfiltr.c#L517) and customize to your liking. A list of scan codes (make codes) is available [here](https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input#scan-codes). Works for PS/2 and HID (USB, Bluetooth) keyboards.\n\n## How to?\n\nFirst of all, obviously, compile the driver on your machine (I have tested it solely on `x64` architecture). You need to have installed the [WDK](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) for this.\n\nTo run in a secure manner, I recommend [this](https://github.com/valinet/ssde), which is implied in the installation procedure below. So, to start, ensure ssde runs with Secure Boot on (`Confirm-SecureBootUEFI` in PowerShell); no need to enable test signing or Test Mode.\n\nRemove the test signature from the driver:\n\n```\nsigntool remove /s kbfiltr.sys\n```\n\nSign the driver with the certificate created for ssde. Replace `password` with your certificate's password, and `17cf4521f162442bf61d3a09ec8c4455456eaf54` with the SHA1 of your `localhost-km.der` file.\n\n```\nsigntool sign /fd sha256 /ac .\\localhost-root-ca.der /f .\\localhost-km.pfx /p password /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 /sha1 17cf4521f162442bf61d3a09ec8c4455456eaf54 kbfiltr.sys\n```\n\nCopy driver to `C:\\Windows\\System32\\drivers`.\n\n```\ndel C:\\Windows\\System32\\drivers\\kbfiltr.sysO\nren C:\\Windows\\System32\\drivers\\kbfiltr.sys kbfiltr.sysO\nxcopy /Y kbfiltr.sys C:\\Windows\\System32\\drivers\n```\n\nInstall driver in the system.\n\n```\nsc create kbfiltr binpath=%windir%\\system32\\drivers\\kbfiltr.sys type=kernel start=demand error=normal\n```\n\nRegister driver as filter for the keyboard device class: in the Windows Registry, go to `HKLM\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e96b-e325-11ce-bfc1-08002be10318}`, edit `UpperFilters` and add `kbfiltr` on a new line before `kbdclass` (`UpperFilters` is of type `REG_MULTI_SZ`).\n\n```\nWindows Registry Editor Version 5.00\n\n[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e96b-e325-11ce-bfc1-08002be10318}]\n\"UpperFilters\"=hex(7):6b,00,62,00,66,00,69,00,6c,00,74,00,72,00,00,00,6b,00,62,\\\n  00,64,00,63,00,6c,00,61,00,73,00,73,00,00,00,00,00\n```\n\nReboot the system end enjoy.\n\n## Previous version\n\nA simple Windows PS/2 filter driver based on the [sample from Microsoft](https://docs.microsoft.com/en-us/samples/microsoft/windows-driver-samples/keyboard-input-wdf-filter-driver-kbfiltr/) that remaps some keys on the Dell XPS 15 7590's keyboard to my personal preference.\n\nTo run in a secure manner, [try this](https://github.com/valinet/ssde).\n\nTo install, do this (use elevated \"x64 Native Tools Command Prompt for Visual Studio 2019\"):\n\n```\ncd bin_folder\n\"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x86\\Inf2Cat.exe\" /driver:. /os:10_19H1_X64\nsigntool sign /fd sha256 /a /ac C:\\Certificates\\localhost-root-ca.der /f C:\\Certificates\\localhost-km.pfx /p password /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp xps15kbfix.cat\ndevcon install kbfiltr.inf ACPI\\VEN_DLLK\u0026DEV_0905\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalinet%2Fxps15kbfix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalinet%2Fxps15kbfix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalinet%2Fxps15kbfix/lists"}