Skip to content

Instantly share code, notes, and snippets.

@tomykaira
Created September 25, 2015 14:24
Show Gist options
  • Save tomykaira/82ec6843bf768a16bc82 to your computer and use it in GitHub Desktop.
Save tomykaira/82ec6843bf768a16bc82 to your computer and use it in GitHub Desktop.
windows 10 キー書き換え
kbd106.dll を用意する。
Win8 だとビルドできたが 10 ではできなかったので
http://www.codeproject.com/Articles/439275/Loading-keyboard-layout-KbdLayerDescriptor-in
で C:\Windows\system32\kbd106.dll をロードし、好みの状態になるようにバイナリエディタで書き換える --
syswow にもあるが、OS は system32 のほうを使っている、ビット長が違うこともあり、中身は異なるので注意。
win 10 だと 0xD70 あたりからが数字キー
変換、無変換はキーがテーブルになかったため、 scancode -> VK 変換のテーブル (0xA80-0xC20) をいじって 変換
(0x79): 0x041C -> OEM8(0xDF), 無変換(0x7b):0x041D -> 7(0x0037)
に読み替え、未使用だった OEM8 をすべて _ にしている
レジストリでやる方法もあるが、OEM8のスキャンコードがないっぽかった
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,DF,00,79,00.08.00.7b,00,00,00,00,00
http://superuser.com/questions/630964/how-to-edit-keyboard-registry-settings-for-keys-with-3-character-scan-codes
http://www.northcode.com/blog.php/2007/07/25/Securing-Windows-For-Use-As-A-Kiosk
できたら TrustedInstaller 無効化、削除、インストール、有効化の手順を踏む。
NT SERVICE\TrustedInstaller とすればプリンシパルに選択できる。
無効化: http://helpdeskgeek.com/windows-7/windows-7-how-to-delete-files-protected-by-trustedinstaller/
有効化: http://www.askvg.com/guide-how-to-restore-trustedinstaller-as-default-owner-of-a-file-or-folder-in-windows/
コマンドでやるのは
takeown /f kbd106.dll
icacls kbd106.dll /grant Administrators:(F)
copy edited_kbd106.dll kbd106.dll
戻したくなったら
sfc /scanfile=c:\windows\notepad.exe
http://yamori-jp.blogspot.jp/2011/04/windows7.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment