From 4717a5b6f7aed96e20a577443c446fa83f185442 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 25 Apr 2026 23:01:58 +0200 Subject: [PATCH] docs(research): canonical retail keymap + dump-keymap tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-Phase K research artifact. Captures the AC retail default keymap in two complementary forms so the upcoming InputAction enum + retail preset (Phase K.1c) can be built byte-precise. - docs/research/named-retail/retail-default.keymap.txt — verbatim copy of the user's test.keymap from ~/Documents/Asheron's Call/. Human-readable text format with every binding categorized: MovementCommands (W/X/A/D/Z/C/Q/Space/ LShift/S + Y/G/H/B postures), ItemSelectionCommands (F/T/P + 18 punctuation keys for compass/item/monster/player/fellow targeting), UICommands (F1-F12 panel toggles, R=USE, E=Examine, Esc=close, Shift+Esc=Logout), QuickslotCommands (1-9 + Ctrl/Alt variants for hotbar pages), Combat / MeleeCombat / MissileCombat / MagicCombat (mode-dependent Insert/PgUp/Delete/End/PgDn), Emotes (U=Cry, I=Laugh, J=Wave, O=Cheer, K=Point), CameraControls (numpad cluster), MouseCommands, ScrollableControls, EditControls, CopyAndPasteControls, DialogBoxes. 346 lines. - docs/research/named-retail/keymap-default.txt — binary dump of the gmDefaultMap MasterInputMap from client_portal.dat at file id 0x14000000. Decoded via the new tools/dump-keymap utility: scancodes + modifier flags + action IDs + activation phase per context. Confirms the text file's bindings against the dat-shipped default. Cross-referenced against acclient_2013_pseudo_c.txt:405510 (ACCmdInterp::OnAction) for the movement dispatch logic and :365889 (CPlayerSystem::OnAction) for the targeting dispatch. - tools/dump-keymap/ — dotnet console tool referencing references/DatReaderWriter. Reads MasterInputMap entries from a dat directory + emits human-readable per-context binding tables. Reusable for future custom keymap analysis. Run with: dotnet run --project tools/dump-keymap/dump-keymap.csproj -c Release Default dat dir is %USERPROFILE%/Documents/Asheron's Call. Foundation for Phase K — control system overhaul. Plan documented at ~/.claude/plans/ticklish-conjuring-cake.md. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/research/named-retail/keymap-default.txt | 262 +++++++++++++ .../named-retail/retail-default.keymap.txt | 346 ++++++++++++++++++ tools/dump-keymap/Program.cs | 212 +++++++++++ tools/dump-keymap/dump-keymap.csproj | 13 + tools/dump-keymap/dump.txt | 262 +++++++++++++ 5 files changed, 1095 insertions(+) create mode 100644 docs/research/named-retail/keymap-default.txt create mode 100644 docs/research/named-retail/retail-default.keymap.txt create mode 100644 tools/dump-keymap/Program.cs create mode 100644 tools/dump-keymap/dump-keymap.csproj create mode 100644 tools/dump-keymap/dump.txt diff --git a/docs/research/named-retail/keymap-default.txt b/docs/research/named-retail/keymap-default.txt new file mode 100644 index 0000000..53bf4b2 --- /dev/null +++ b/docs/research/named-retail/keymap-default.txt @@ -0,0 +1,262 @@ +C:\Users\erikn\source\repos\acdream\tools\dump-keymap\Program.cs(142,15): warning CS8321: The local function 'Action' is declared but never used [C:\Users\erikn\source\repos\acdream\tools\dump-keymap\dump-keymap.csproj] +# Reading dats from: C:\Users\erikn\Documents\Asheron's Call + +## MasterInputMap 0x14000000 + Name: gmDefaultMap + GuidMap: 451f8ccc-a7e9-4df4-9a6b-f4a7c706f300 + Devices: 2 + Keyboard 6f1d2b61-d5a0-11cf-bfc7-444553540000 + Mouse 6f1d2b60-d5a0-11cf-bfc7-444553540000 + MetaKeys (9): + LSHIFT (scan=0x2A, dev=0) ModifierFlag=0x80000000 + LCONTROL (scan=0x1D, dev=0) ModifierFlag=0x40000000 + RCONTROL (scan=0x9D, dev=0) ModifierFlag=0x40000000 + LMENU (scan=0x38, dev=0) ModifierFlag=0x20000000 + RMENU (scan=0xB8, dev=0) ModifierFlag=0x20000000 + ?0xDB (scan=0xDB, dev=0) ModifierFlag=0x10000000 + ?0xDC (scan=0xDC, dev=0) ModifierFlag=0x10000000 + TAB (scan=0x0F, dev=1) ModifierFlag=0x08000000 + Q (scan=0x10, dev=1) ModifierFlag=0x04000000 + InputMaps (14): + + Context 0x00000004 (22 bindings): + Q (scan=0x10, dev=0) Action=0x00000030 Activation=0x03 + W (scan=0x11, dev=0) Action=0x00000029 Activation=0x03 + Y (scan=0x15, dev=0) Action=0x10000094 Activation=0x03 + A +Alt (scan=0x1E, dev=0) Action=0x0000002D Activation=0x03 + A (scan=0x1E, dev=0) Action=0x0000002F Activation=0x03 + S (scan=0x1F, dev=0) Action=0x0000002B Activation=0x03 + D (scan=0x20, dev=0) Action=0x0000002E Activation=0x03 + D +Alt (scan=0x20, dev=0) Action=0x0000002C Activation=0x03 + G (scan=0x22, dev=0) Action=0x10000096 Activation=0x03 + H (scan=0x23, dev=0) Action=0x10000095 Activation=0x03 + LSHIFT (scan=0x2A, dev=0) Action=0x00000032 Activation=0x03 + Z (scan=0x2C, dev=0) Action=0x0000002D Activation=0x03 + X (scan=0x2D, dev=0) Action=0x0000002A Activation=0x03 + C (scan=0x2E, dev=0) Action=0x0000002C Activation=0x03 + B (scan=0x30, dev=0) Action=0x10000097 Activation=0x03 + SPACE (scan=0x39, dev=0) Action=0x00000031 Activation=0x03 + UP (scan=0xC8, dev=0) Action=0x00000029 Activation=0x03 + LEFT +Alt (scan=0xCB, dev=0) Action=0x0000002D Activation=0x03 + LEFT (scan=0xCB, dev=0) Action=0x0000002F Activation=0x03 + RIGHT (scan=0xCD, dev=0) Action=0x0000002E Activation=0x03 + RIGHT +Alt (scan=0xCD, dev=0) Action=0x0000002C Activation=0x03 + DOWN (scan=0xD0, dev=0) Action=0x0000002A Activation=0x03 + + Context 0x00000005 (2 bindings): + F2 (scan=0x3C, dev=0) Action=0x0000003E Activation=0x03 + DIVIDE (scan=0xB5, dev=0) Action=0x0000003E Activation=0x03 + + Context 0x00000006 (4 bindings): + UP (scan=0xC8, dev=0) Action=0x00000037 Activation=0x03 + LEFT (scan=0xCB, dev=0) Action=0x00000035 Activation=0x03 + RIGHT (scan=0xCD, dev=0) Action=0x00000036 Activation=0x03 + DOWN (scan=0xD0, dev=0) Action=0x00000038 Activation=0x03 + + Context 0x10000002 (1 bindings): + GRAVE (scan=0x29, dev=0) Action=0x1000005A Activation=0x03 + + Context 0x10000003 (5 bindings): + PRIOR (scan=0xC9, dev=0) Action=0x1000005C Activation=0x03 + END (scan=0xCF, dev=0) Action=0x1000005E Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x1000005F Activation=0x03 + INSERT (scan=0xD2, dev=0) Action=0x1000005B Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x1000005D Activation=0x03 + + Context 0x10000004 (5 bindings): + PRIOR (scan=0xC9, dev=0) Action=0x100000F0 Activation=0x03 + END (scan=0xCF, dev=0) Action=0x100000F2 Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x100000F3 Activation=0x03 + INSERT (scan=0xD2, dev=0) Action=0x100000EF Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x100000F1 Activation=0x03 + + Context 0x10000005 (18 bindings): + 1 (scan=0x02, dev=0) Action=0x10000065 Activation=0x03 + 2 (scan=0x03, dev=0) Action=0x10000066 Activation=0x03 + 3 (scan=0x04, dev=0) Action=0x10000067 Activation=0x03 + 4 (scan=0x05, dev=0) Action=0x10000068 Activation=0x03 + 5 (scan=0x06, dev=0) Action=0x10000069 Activation=0x03 + 6 (scan=0x07, dev=0) Action=0x1000006A Activation=0x03 + 7 (scan=0x08, dev=0) Action=0x1000006B Activation=0x03 + 8 (scan=0x09, dev=0) Action=0x1000006C Activation=0x03 + 9 (scan=0x0A, dev=0) Action=0x1000006D Activation=0x03 + PRIOR (scan=0xC9, dev=0) Action=0x10000064 Activation=0x03 + PRIOR +Ctrl (scan=0xC9, dev=0) Action=0x10000105 Activation=0x03 + END (scan=0xCF, dev=0) Action=0x10000060 Activation=0x03 + NEXT +Ctrl (scan=0xD1, dev=0) Action=0x10000103 Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x10000062 Activation=0x03 + INSERT +Ctrl (scan=0xD2, dev=0) Action=0x10000104 Activation=0x03 + INSERT (scan=0xD2, dev=0) Action=0x10000063 Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x10000061 Activation=0x03 + DELETE +Ctrl (scan=0xD3, dev=0) Action=0x10000102 Activation=0x03 + + Context 0x10000006 (5 bindings): + U (scan=0x16, dev=0) Action=0x100000A7 Activation=0x03 + I (scan=0x17, dev=0) Action=0x100000B2 Activation=0x03 + O (scan=0x18, dev=0) Action=0x100000A2 Activation=0x03 + J (scan=0x24, dev=0) Action=0x100000E5 Activation=0x03 + K (scan=0x25, dev=0) Action=0x100000BE Activation=0x03 + + Context 0x10000007 (18 bindings): + MINUS (scan=0x0C, dev=0) Action=0x10000030 Activation=0x03 + EQUALS (scan=0x0D, dev=0) Action=0x10000031 Activation=0x03 + BACK (scan=0x0E, dev=0) Action=0x1000002F Activation=0x03 + T (scan=0x14, dev=0) Action=0x1000002D Activation=0x03 + P (scan=0x19, dev=0) Action=0x1000002E Activation=0x03 + LBRACKET (scan=0x1A, dev=0) Action=0x10000033 Activation=0x03 + RBRACKET (scan=0x1B, dev=0) Action=0x10000034 Activation=0x03 + F (scan=0x21, dev=0) Action=0x1000002C Activation=0x03 + L (scan=0x26, dev=0) Action=0x10000036 Activation=0x03 + SEMICOLON (scan=0x27, dev=0) Action=0x10000037 Activation=0x03 + APOSTROPHE (scan=0x28, dev=0) Action=0x10000035 Activation=0x03 + BACKSLASH (scan=0x2B, dev=0) Action=0x10000032 Activation=0x03 + N (scan=0x31, dev=0) Action=0x1000003C Activation=0x03 + M (scan=0x32, dev=0) Action=0x1000003D Activation=0x03 + COMMA (scan=0x33, dev=0) Action=0x1000003A Activation=0x03 + PERIOD (scan=0x34, dev=0) Action=0x1000003B Activation=0x03 + SLASH (scan=0x35, dev=0) Action=0x10000039 Activation=0x03 + HOME (scan=0xC7, dev=0) Action=0x10000038 Activation=0x03 + + Context 0x10000009 (20 bindings): + ESCAPE +Shift (scan=0x01, dev=0) Action=0x10000026 Activation=0x03 + ESCAPE (scan=0x01, dev=0) Action=0x00000027 Activation=0x03 + 1 +Alt (scan=0x02, dev=0) Action=0x10000114 Activation=0x03 + 2 +Alt (scan=0x03, dev=0) Action=0x10000115 Activation=0x03 + 3 +Alt (scan=0x04, dev=0) Action=0x10000116 Activation=0x03 + 4 +Alt (scan=0x05, dev=0) Action=0x10000117 Activation=0x03 + E (scan=0x12, dev=0) Action=0x1000002B Activation=0x03 + R (scan=0x13, dev=0) Action=0x10000025 Activation=0x03 + MULTIPLY (scan=0x37, dev=0) Action=0x00000055 Activation=0x03 + F1 +Shift|Ctrl (scan=0x3B, dev=0) Action=0x0000007C Activation=0x03 + F1 (scan=0x3B, dev=0) Action=0x0000007B Activation=0x03 + F3 (scan=0x3D, dev=0) Action=0x1000000E Activation=0x03 + F4 (scan=0x3E, dev=0) Action=0x1000000F Activation=0x03 + F5 (scan=0x3F, dev=0) Action=0x10000011 Activation=0x03 + F6 (scan=0x40, dev=0) Action=0x10000012 Activation=0x03 + F8 (scan=0x42, dev=0) Action=0x10000014 Activation=0x03 + F9 (scan=0x43, dev=0) Action=0x10000015 Activation=0x03 + F10 (scan=0x44, dev=0) Action=0x10000016 Activation=0x03 + F11 (scan=0x57, dev=0) Action=0x1000001A Activation=0x03 + F12 (scan=0x58, dev=0) Action=0x10000019 Activation=0x03 + + Context 0x1000000A (1 bindings): + RETURN (scan=0x1C, dev=0) Action=0x10000023 Activation=0x03 + + Context 0x1000000B (2 bindings): + MINUS (scan=0x0C, dev=1) Action=0x00000007 Activation=0x03 + EQUALS (scan=0x0D, dev=1) Action=0x00000008 Activation=0x03 + + Context 0x1000000C (29 bindings): + 1 (scan=0x02, dev=0) Action=0x10000042 Activation=0x03 + 1 +Alt (scan=0x02, dev=0) Action=0x1000004B Activation=0x03 + 1 +Ctrl (scan=0x02, dev=0) Action=0x10000042 Activation=0x03 + 2 (scan=0x03, dev=0) Action=0x10000043 Activation=0x03 + 2 +Alt (scan=0x03, dev=0) Action=0x1000004C Activation=0x03 + 2 +Ctrl (scan=0x03, dev=0) Action=0x10000043 Activation=0x03 + 3 (scan=0x04, dev=0) Action=0x10000044 Activation=0x03 + 3 +Ctrl (scan=0x04, dev=0) Action=0x10000044 Activation=0x03 + 3 +Alt (scan=0x04, dev=0) Action=0x1000004D Activation=0x03 + 4 (scan=0x05, dev=0) Action=0x10000045 Activation=0x03 + 4 +Ctrl (scan=0x05, dev=0) Action=0x10000045 Activation=0x03 + 4 +Alt (scan=0x05, dev=0) Action=0x10000132 Activation=0x03 + 5 (scan=0x06, dev=0) Action=0x10000046 Activation=0x03 + 5 +Ctrl (scan=0x06, dev=0) Action=0x10000046 Activation=0x03 + 5 +Alt (scan=0x06, dev=0) Action=0x10000133 Activation=0x03 + 6 +Ctrl (scan=0x07, dev=0) Action=0x10000047 Activation=0x03 + 6 +Alt (scan=0x07, dev=0) Action=0x10000134 Activation=0x03 + 6 (scan=0x07, dev=0) Action=0x10000047 Activation=0x03 + 7 +Alt (scan=0x08, dev=0) Action=0x10000135 Activation=0x03 + 7 (scan=0x08, dev=0) Action=0x10000048 Activation=0x03 + 7 +Ctrl (scan=0x08, dev=0) Action=0x10000048 Activation=0x03 + 8 (scan=0x09, dev=0) Action=0x10000049 Activation=0x03 + 8 +Ctrl (scan=0x09, dev=0) Action=0x10000049 Activation=0x03 + 8 +Alt (scan=0x09, dev=0) Action=0x10000136 Activation=0x03 + 9 +Alt (scan=0x0A, dev=0) Action=0x10000137 Activation=0x03 + 9 +Ctrl (scan=0x0A, dev=0) Action=0x1000004A Activation=0x03 + 9 (scan=0x0A, dev=0) Action=0x1000004A Activation=0x03 + 0 (scan=0x0B, dev=0) Action=0x1000010D Activation=0x03 + 0 +Ctrl (scan=0x0B, dev=0) Action=0x1000010D Activation=0x03 + + Context 0x1000000D (1 bindings): + TAB (scan=0x0F, dev=0) Action=0x10000024 Activation=0x03 + +## MasterInputMap 0x14000002 + Name: DefaultMap + GuidMap: 451f8ccc-a7e9-4df4-9a6b-f4a7c706f300 + Devices: 2 + Keyboard 6f1d2b61-d5a0-11cf-bfc7-444553540000 + Mouse 6f1d2b60-d5a0-11cf-bfc7-444553540000 + MetaKeys (7): + LSHIFT (scan=0x2A, dev=0) ModifierFlag=0x80000000 + LCONTROL (scan=0x1D, dev=0) ModifierFlag=0x40000000 + RCONTROL (scan=0x9D, dev=0) ModifierFlag=0x40000000 + LMENU (scan=0x38, dev=0) ModifierFlag=0x20000000 + RMENU (scan=0xB8, dev=0) ModifierFlag=0x20000000 + ?0xDB (scan=0xDB, dev=0) ModifierFlag=0x10000000 + ?0xDC (scan=0xDC, dev=0) ModifierFlag=0x10000000 + InputMaps (7): + + Context 0x00000003 (8 bindings): + ?0x00 (scan=0x00, dev=1) Action=0x00000002 Activation=0x80 + 3 (scan=0x04, dev=1) Action=0x00000003 Activation=0x80 + MINUS (scan=0x0C, dev=1) Action=0x00000007 Activation=0x03 + MINUS (scan=0x0C, dev=1) Action=0x0000000A Activation=0x60 + EQUALS (scan=0x0D, dev=1) Action=0x00000008 Activation=0x03 + EQUALS (scan=0x0D, dev=1) Action=0x0000000B Activation=0x60 + BACK (scan=0x0E, dev=1) Action=0x00000009 Activation=0x03 + BACK (scan=0x0E, dev=1) Action=0x0000000C Activation=0x60 + + Context 0x00000005 (11 bindings): + BACK (scan=0x0E, dev=1) Action=0x0000003D Activation=0x03 + NUMPAD8 (scan=0x48, dev=0) Action=0x00000037 Activation=0x03 + SUBTRACT (scan=0x4A, dev=0) Action=0x00000033 Activation=0x03 + NUMPAD4 (scan=0x4B, dev=0) Action=0x00000035 Activation=0x03 + NUMPAD5 (scan=0x4C, dev=0) Action=0x0000003B Activation=0x03 + NUMPAD6 (scan=0x4D, dev=0) Action=0x00000036 Activation=0x03 + ADD (scan=0x4E, dev=0) Action=0x00000034 Activation=0x03 + NUMPAD2 (scan=0x50, dev=0) Action=0x00000038 Activation=0x03 + NUMPAD0 (scan=0x52, dev=0) Action=0x00000039 Activation=0x03 + DECIMAL (scan=0x53, dev=0) Action=0x0000003A Activation=0x03 + NUMPADENTER (scan=0x9C, dev=0) Action=0x0000003C Activation=0x03 + + Context 0x00000007 (16 bindings): + ESCAPE (scan=0x01, dev=0) Action=0x00000027 Activation=0x03 + BACK (scan=0x0E, dev=0) Action=0x00000028 Activation=0x03 + RETURN (scan=0x1C, dev=0) Action=0x00000025 Activation=0x03 + HOME (scan=0xC7, dev=0) Action=0x0000001A Activation=0x03 + HOME +Ctrl (scan=0xC7, dev=0) Action=0x0000001C Activation=0x03 + UP (scan=0xC8, dev=0) Action=0x0000001E Activation=0x03 + PRIOR (scan=0xC9, dev=0) Action=0x00000020 Activation=0x03 + LEFT (scan=0xCB, dev=0) Action=0x00000016 Activation=0x03 + LEFT +Ctrl (scan=0xCB, dev=0) Action=0x00000018 Activation=0x03 + RIGHT (scan=0xCD, dev=0) Action=0x00000017 Activation=0x03 + RIGHT +Ctrl (scan=0xCD, dev=0) Action=0x00000019 Activation=0x03 + END (scan=0xCF, dev=0) Action=0x0000001B Activation=0x03 + END +Ctrl (scan=0xCF, dev=0) Action=0x0000001D Activation=0x03 + DOWN (scan=0xD0, dev=0) Action=0x0000001F Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x00000021 Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x00000026 Activation=0x03 + + Context 0x00000008 (6 bindings): + X +Ctrl (scan=0x2D, dev=0) Action=0x00000023 Activation=0x03 + C +Ctrl (scan=0x2E, dev=0) Action=0x00000022 Activation=0x03 + V +Ctrl (scan=0x2F, dev=0) Action=0x00000024 Activation=0x03 + INSERT +Ctrl (scan=0xD2, dev=0) Action=0x00000022 Activation=0x03 + INSERT +Shift (scan=0xD2, dev=0) Action=0x00000024 Activation=0x03 + DELETE +Shift (scan=0xD3, dev=0) Action=0x00000023 Activation=0x03 + + Context 0x00000009 (2 bindings): + ESCAPE (scan=0x01, dev=0) Action=0x00000027 Activation=0x03 + RETURN (scan=0x1C, dev=0) Action=0x00000025 Activation=0x03 + + Context 0x0000000A (4 bindings): + 7 (scan=0x08, dev=257) Action=0x00000005 Activation=0x03 + 7 (scan=0x08, dev=513) Action=0x00000006 Activation=0x03 + UP +Ctrl (scan=0xC8, dev=0) Action=0x00000005 Activation=0x03 + DOWN +Ctrl (scan=0xD0, dev=0) Action=0x00000006 Activation=0x03 + + Context 0x00000010 (4 bindings): + ESCAPE +Shift|Ctrl (scan=0x01, dev=0) Action=0x0000007F Activation=0x03 + TAB +Alt (scan=0x0F, dev=0) Action=0x00000053 Activation=0x03 + RETURN +Alt (scan=0x1C, dev=0) Action=0x0000007D Activation=0x03 + F4 +Alt (scan=0x3E, dev=0) Action=0x0000007E Activation=0x03 diff --git a/docs/research/named-retail/retail-default.keymap.txt b/docs/research/named-retail/retail-default.keymap.txt new file mode 100644 index 0000000..06c3e66 --- /dev/null +++ b/docs/research/named-retail/retail-default.keymap.txt @@ -0,0 +1,346 @@ +#Asheron's Call: Throne of Destiny Keymap File +# +#Most users will never want or need to edit this file by hand. To edit your +#keymap, click the options button, select the Gameplay Options tab, and click +#'Configure Keyboard'. +# +#However it is possible to configure your keyboard by editing this file. +# +#Important notes: AC:TD will generate a brand-new acclient.keymap in your +#My Documents\Asheron's Call folder if it tries to use one and can't find one. +#So if you do completely break your keymap, you can start over by deleting +#this file. +# +#AC:TD writes to the keymap file on shutdown of the client. If you make changes +#in this file while the client is running, it will overwrite them on shutdown. +# +#If you make changes in the Configure Keyboard options and save them to a new +#file, that will be the default keymap file the next time AC:TD starts up. +# +#Key bindings can be edited under the 'Bindings' header. There are several key fields. +# +#The first field is the Action. This is defined by the game. To find the name of a +#particular Action, bind a key to it in the Configure Keyboard menu in the client. +#Exit the client and you will see the name in the Bindings header. +# +#The second field is the device. Devices are enumerated under the Devices header. +#Generally device 0 is keyboard, device 1 is mouse, other devices follow. +# +#The third field is the key or action. A full list of available actions for this field +#can be found in Microsoft's DirectX documentation at http://msdn.microsoft.com. +# +#The fourth field is the subcontrol. It can be used to define positive or negative axis +#for an X, Y or Z input, as well as other options. +# +#The fifth field is also optional, it defines which metakeys need to be depressed. The +#metakeys are defined and enumerated under the Metakeys header. The number next to +#the metakey is a bit, metakeys can be combined. +# +#For example the default for Left Shift (DIK_LSHIFT) is 1, and Left Control +#(DIK_LCONTROL) is 2. I could bind a key to CTRL-SHIFT-M by using DIK_M 0x00000003. +# +#It is possible to edit the Metakey enumeration but this is not recommended for any but +#the most advanced computer users. +# +#The sixth, optional field is the activation type. Generally this is only used for mouse +#buttons and the most common type is MouseDblClick, but there are other options. +# +#Again, more detailed documentation can be found at http://msdn.microsoft.com. +# +#Turbine cannot provide support for advanced keymap editing. +# +# +"User Defined Keymap" [ 0000004B-0500-0000-0004-000016000000 ] + +Devices +[ + Keyboard [ GUID_SysKeyboard ] + Mouse [ GUID_SysMouse ] + Virtual [ GUID_Virtual ] + Joystick [ 83325D40-E98A-11F0-8001-444553540000 ] + Joystick [ 83332090-E98A-11F0-8003-444553540000 ] + Joystick [ 83328450-E98A-11F0-8002-444553540000 ] + Joystick [ 8333BCD0-E98A-11F0-8005-444553540000 ] + Joystick [ 83343200-E98A-11F0-8006-444553540000 ] + Joystick [ 83343200-E98A-11F0-8007-444553540000 ] + Joystick [ 83345910-E98A-11F0-8008-444553540000 ] + Joystick [ 83345910-E98A-11F0-8009-444553540000 ] + Joystick [ 83332090-E98A-11F0-8004-444553540000 ] + Joystick [ 83345910-E98A-11F0-800A-444553540000 ] +] + +MetaKeys +[ + 1 [ 0 DIK_LSHIFT ] + 2 [ 0 DIK_LCONTROL ] + 2 [ 0 DIK_RCONTROL ] + 3 [ 0 DIK_LMENU ] + 3 [ 0 DIK_RALT ] + 4 [ 0 DIK_LWIN ] + 4 [ 0 DIK_RWIN ] + 5 [ 1 DIMOFS_BUTTON3 ] + 6 [ 1 DIMOFS_BUTTON4 ] +] + +Bindings +[ + MovementCommands + [ + MovementJump [ "" [ 0 DIK_SPACE ] ] + MovementForward [ "" [ 0 DIK_W ] ] + MovementForward [ "" [ 0 DIK_UPARROW ] ] + MovementBackup [ "" [ 0 DIK_X ] ] + MovementBackup [ "" [ 0 DIK_DOWNARROW ] ] + MovementTurnLeft [ "" [ 0 DIK_A ] ] + MovementTurnLeft [ "" [ 0 DIK_LEFT ] ] + MovementTurnRight [ "" [ 0 DIK_D ] ] + MovementTurnRight [ "" [ 0 DIK_RIGHTARROW ] ] + MovementStrafeLeft [ "" [ 0 DIK_Z ] ] + MovementStrafeLeft [ "" [ 0 DIK_A ] 0x00000004 ] + MovementStrafeLeft [ "" [ 0 DIK_LEFT ] 0x00000004 ] + MovementStrafeRight [ "" [ 0 DIK_C ] ] + MovementStrafeRight [ "" [ 0 DIK_D ] 0x00000004 ] + MovementStrafeRight [ "" [ 0 DIK_RIGHTARROW ] 0x00000004 ] + MovementWalkMode [ "" [ 0 DIK_LSHIFT ] ] + MovementRunLock [ "" [ 0 DIK_Q ] ] + MovementStop [ "" [ 0 DIK_S ] ] + Ready [ "" [ 0 DIK_Y ] ] + Sitting [ "" [ 0 DIK_G ] ] + Crouch [ "" [ 0 DIK_H ] ] + Sleeping [ "" [ 0 DIK_B ] ] + ] + + ItemSelectionCommands + [ + SelectionPickUp [ "" [ 0 DIK_F ] ] + SelectionSplitStack [ "" [ 0 DIK_T ] ] + SelectionPreviousSelection [ "" [ 0 DIK_P ] ] + SelectionClosestCompassItem [ "" [ 0 DIK_BACK ] ] + SelectionPreviousCompassItem [ "" [ 0 DIK_MINUS ] ] + SelectionNextCompassItem [ "" [ 0 DIK_EQUALS ] ] + SelectionClosestItem [ "" [ 0 DIK_BACKSLASH ] ] + SelectionPreviousItem [ "" [ 0 DIK_LBRACKET ] ] + SelectionNextItem [ "" [ 0 DIK_RBRACKET ] ] + SelectionClosestMonster [ "" [ 0 DIK_APOSTROPHE ] ] + SelectionPreviousMonster [ "" [ 0 DIK_L ] ] + SelectionNextMonster [ "" [ 0 DIK_SEMICOLON ] ] + SelectionLastAttacker [ "" [ 0 DIK_HOME ] ] + SelectionClosestPlayer [ "" [ 0 DIK_SLASH ] ] + SelectionPreviousPlayer [ "" [ 0 DIK_COMMA ] ] + SelectionNextPlayer [ "" [ 0 DIK_PERIOD ] ] + SelectionPreviousFellow [ "" [ 0 DIK_N ] ] + SelectionNextFellow [ "" [ 0 DIK_M ] ] + ] + + UICommands + [ + SelectionExamine [ "" [ 0 DIK_E ] ] + CaptureScreenshot [ "" [ 0 DIK_NUMPADSTAR ] ] + ToggleHelp [ "" [ 0 DIK_F1 ] ] + TogglePluginManager [ "" [ 0 DIK_F1 ] 0x00000003 ] + ToggleAllegiancePanel [ "" [ 0 DIK_F3 ] ] + ToggleFellowshipPanel [ "" [ 0 DIK_F4 ] ] + ToggleSpellbookPanel [ "" [ 0 DIK_F5 ] ] + ToggleSpellComponentsPanel [ "" [ 0 DIK_F6 ] ] + ToggleAttributesPanel [ "" [ 0 DIK_F8 ] ] + ToggleSkillsPanel [ "" [ 0 DIK_F9 ] ] + ToggleWorldPanel [ "" [ 0 DIK_F10 ] ] + ToggleOptionsPanel [ "" [ 0 DIK_F11 ] ] + ToggleInventoryPanel [ "" [ 0 DIK_F12 ] ] + ToggleFloatingChatWindow1 [ "" [ 0 DIK_1 ] 0x00000004 ] + ToggleFloatingChatWindow2 [ "" [ 0 DIK_2 ] 0x00000004 ] + ToggleFloatingChatWindow3 [ "" [ 0 DIK_3 ] 0x00000004 ] + ToggleFloatingChatWindow4 [ "" [ 0 DIK_4 ] 0x00000004 ] + USE [ "" [ 0 DIK_R ] ] + EscapeKey [ "" [ 0 DIK_ESCAPE ] ] + LOGOUT [ "" [ 0 DIK_ESCAPE ] 0x00000001 ] + ] + + QuickslotCommands + [ + UseQuickSlot_1 [ "" [ 0 DIK_1 ] ] + UseQuickSlot_2 [ "" [ 0 DIK_2 ] ] + UseQuickSlot_3 [ "" [ 0 DIK_3 ] ] + UseQuickSlot_4 [ "" [ 0 DIK_4 ] ] + UseQuickSlot_5 [ "" [ 0 DIK_5 ] ] + UseQuickSlot_6 [ "" [ 0 DIK_6 ] ] + UseQuickSlot_7 [ "" [ 0 DIK_7 ] ] + UseQuickSlot_8 [ "" [ 0 DIK_8 ] ] + UseQuickSlot_9 [ "" [ 0 DIK_9 ] ] + UseQuickSlot_14 [ "" [ 0 DIK_5 ] 0x00000004 ] + UseQuickSlot_15 [ "" [ 0 DIK_6 ] 0x00000004 ] + UseQuickSlot_16 [ "" [ 0 DIK_7 ] 0x00000004 ] + UseQuickSlot_17 [ "" [ 0 DIK_8 ] 0x00000004 ] + UseQuickSlot_18 [ "" [ 0 DIK_9 ] 0x00000004 ] + CreateShortcut [ "" [ 0 DIK_0 ] ] + UseQuickSlot_1 [ "" [ 0 DIK_1 ] 0x00000002 ] + UseQuickSlot_2 [ "" [ 0 DIK_2 ] 0x00000002 ] + UseQuickSlot_3 [ "" [ 0 DIK_3 ] 0x00000002 ] + UseQuickSlot_4 [ "" [ 0 DIK_4 ] 0x00000002 ] + UseQuickSlot_5 [ "" [ 0 DIK_5 ] 0x00000002 ] + UseQuickSlot_6 [ "" [ 0 DIK_6 ] 0x00000002 ] + UseQuickSlot_7 [ "" [ 0 DIK_7 ] 0x00000002 ] + UseQuickSlot_8 [ "" [ 0 DIK_8 ] 0x00000002 ] + UseQuickSlot_9 [ "" [ 0 DIK_9 ] 0x00000002 ] + CreateShortcut [ "" [ 0 DIK_0 ] 0x00000002 ] + ] + + ToggleChatEntry + [ + ToggleChatEntry [ "" [ 0 DIK_TAB ] ] + ] + + ChatCommands + [ + EnterChatMode [ "" [ 0 DIK_RETURN ] ] + ] + + Combat + [ + CombatToggleCombat [ "" [ 0 DIK_GRAVE ] ] + ] + + MeleeCombat + [ + CombatDecreaseAttackPower [ "" [ 0 DIK_INSERT ] ] + CombatIncreaseAttackPower [ "" [ 0 DIK_PGUP ] ] + CombatLowAttack [ "" [ 0 DIK_DELETE ] ] + CombatMediumAttack [ "" [ 0 DIK_END ] ] + CombatHighAttack [ "" [ 0 DIK_PGDN ] ] + ] + + MissileCombat + [ + CombatDecreaseMissileAccuracy [ "" [ 0 DIK_INSERT ] ] + CombatIncreaseMissileAccuracy [ "" [ 0 DIK_PGUP ] ] + CombatAimLow [ "" [ 0 DIK_DELETE ] ] + CombatAimMedium [ "" [ 0 DIK_END ] ] + CombatAimHigh [ "" [ 0 DIK_PGDN ] ] + ] + + MagicCombat + [ + CombatPrevSpellTab [ "" [ 0 DIK_INSERT ] ] + CombatNextSpellTab [ "" [ 0 DIK_PGUP ] ] + CombatPrevSpell [ "" [ 0 DIK_DELETE ] ] + CombatCastCurrentSpell [ "" [ 0 DIK_END ] ] + CombatNextSpell [ "" [ 0 DIK_PGDN ] ] + CombatFirstSpellTab [ "" [ 0 DIK_INSERT ] 0x00000002 ] + CombatLastSpellTab [ "" [ 0 DIK_PGUP ] 0x00000002 ] + CombatFirstSpell [ "" [ 0 DIK_DELETE ] 0x00000002 ] + CombatLastSpell [ "" [ 0 DIK_PGDN ] 0x00000002 ] + UseSpellSlot_1 [ "" [ 0 DIK_1 ] ] + UseSpellSlot_2 [ "" [ 0 DIK_2 ] ] + UseSpellSlot_3 [ "" [ 0 DIK_3 ] ] + UseSpellSlot_4 [ "" [ 0 DIK_4 ] ] + UseSpellSlot_5 [ "" [ 0 DIK_5 ] ] + UseSpellSlot_6 [ "" [ 0 DIK_6 ] ] + UseSpellSlot_7 [ "" [ 0 DIK_7 ] ] + UseSpellSlot_8 [ "" [ 0 DIK_8 ] ] + UseSpellSlot_9 [ "" [ 0 DIK_9 ] ] + ] + + Emotes + [ + PointState [ "" [ 0 DIK_K ] ] + Laugh [ "" [ 0 DIK_I ] ] + Wave [ "" [ 0 DIK_J ] ] + Cheer [ "" [ 0 DIK_O ] ] + Cry [ "" [ 0 DIK_U ] ] + ] + + TargetedUsage + [ + SelectLeft [ "" [ 1 DIMOFS_BUTTON0 ] ] + SelectRight [ "" [ 1 DIMOFS_BUTTON1 ] ] + ] + + CameraControls + [ + CameraActivateAlternateMode [ "" [ 0 DIK_NUMPADSLASH ] ] + CameraActivateAlternateMode [ "" [ 0 DIK_F2 ] ] + CameraInstantMouseLook [ "" [ 1 DIMOFS_BUTTON2 ] ] + CameraRotateLeft [ "" [ 0 DIK_NUMPAD4 ] ] + CameraRotateRight [ "" [ 0 DIK_NUMPAD6 ] ] + CameraRotateUp [ "" [ 0 DIK_NUMPAD8 ] ] + CameraRotateDown [ "" [ 0 DIK_NUMPAD2 ] ] + CameraMoveToward [ "" [ 0 DIK_NUMPADMINUS ] ] + CameraMoveAway [ "" [ 0 DIK_NUMPADPLUS ] ] + CameraViewDefault [ "" [ 0 DIK_NUMPAD0 ] ] + CameraViewFirstPerson [ "" [ 0 DIK_DECIMAL ] ] + CameraViewLookDown [ "" [ 0 DIK_NUMPAD5 ] ] + CameraViewMapMode [ "" [ 0 DIK_NUMPADENTER ] ] + ] + + CameraAlternateControls + [ + CameraRotateLeft [ "" [ 0 DIK_LEFT ] ] + CameraRotateRight [ "" [ 0 DIK_RIGHTARROW ] ] + CameraRotateUp [ "" [ 0 DIK_UPARROW ] ] + CameraRotateDown [ "" [ 0 DIK_DOWNARROW ] ] + ] + + SystemKeys + [ + AltEnter [ "" [ 0 DIK_RETURN ] 0x00000004 ] + AltTab [ "" [ 0 DIK_TAB ] 0x00000004 ] + AltF4 [ "" [ 0 DIK_F4 ] 0x00000004 ] + CtrlShiftEsc [ "" [ 0 DIK_ESCAPE ] 0x00000003 ] + ] + + MouseCommands + [ + PointerX [ "" [ 1 DIMOFS_X ] 0x00000000 Analog ] + PointerY [ "" [ 1 DIMOFS_Y ] 0x00000000 Analog ] + SelectLeft [ "" [ 1 DIMOFS_BUTTON0 ] ] + SelectRight [ "" [ 1 DIMOFS_BUTTON1 ] ] + SelectMid [ "" [ 1 DIMOFS_BUTTON2 ] ] + SelectDblLeft [ "" [ 1 DIMOFS_BUTTON0 ] 0x00000000 MouseDblClick ] + SelectDblRight [ "" [ 1 DIMOFS_BUTTON1 ] 0x00000000 MouseDblClick ] + SelectDblMid [ "" [ 1 DIMOFS_BUTTON2 ] 0x00000000 MouseDblClick ] + ] + + ScrollableControls + [ + ScrollUp [ "" [ 1 DIMOFS_Z AxisPositive ] ] + ScrollDown [ "" [ 1 DIMOFS_Z AxisNegative ] ] + ScrollUp [ "" [ 0 DIK_UPARROW ] 0x00000002 ] + ScrollDown [ "" [ 0 DIK_DOWNARROW ] 0x00000002 ] + ] + + EditControls + [ + CursorCharLeft [ "" [ 0 DIK_LEFT ] ] + CursorCharRight [ "" [ 0 DIK_RIGHTARROW ] ] + CursorPreviousLine [ "" [ 0 DIK_UPARROW ] ] + CursorNextLine [ "" [ 0 DIK_DOWNARROW ] ] + CursorPreviousPage [ "" [ 0 DIK_PGUP ] ] + CursorNextPage [ "" [ 0 DIK_PGDN ] ] + CursorWordLeft [ "" [ 0 DIK_LEFT ] 0x00000002 ] + CursorWordRight [ "" [ 0 DIK_RIGHTARROW ] 0x00000002 ] + CursorStartOfLine [ "" [ 0 DIK_HOME ] ] + CursorStartOfDocument [ "" [ 0 DIK_HOME ] 0x00000002 ] + CursorEndOfLine [ "" [ 0 DIK_END ] ] + CursorEndOfDocument [ "" [ 0 DIK_END ] 0x00000002 ] + EscapeKey [ "" [ 0 DIK_ESCAPE ] ] + AcceptInput [ "" [ 0 DIK_RETURN ] ] + DeleteKey [ "" [ 0 DIK_DELETE ] ] + BackspaceKey [ "" [ 0 DIK_BACK ] ] + ] + + CopyAndPasteControls + [ + CopyText [ "" [ 0 DIK_C ] 0x00000002 ] + CopyText [ "" [ 0 DIK_INSERT ] 0x00000002 ] + CutText [ "" [ 0 DIK_X ] 0x00000002 ] + CutText [ "" [ 0 DIK_DELETE ] 0x00000001 ] + PasteText [ "" [ 0 DIK_V ] 0x00000002 ] + PasteText [ "" [ 0 DIK_INSERT ] 0x00000001 ] + ] + + DialogBoxes + [ + EscapeKey [ "" [ 0 DIK_ESCAPE ] ] + AcceptInput [ "" [ 0 DIK_RETURN ] ] + ] +] diff --git a/tools/dump-keymap/Program.cs b/tools/dump-keymap/Program.cs new file mode 100644 index 0000000..22e10c7 --- /dev/null +++ b/tools/dump-keymap/Program.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using DatReaderWriter; +using DatReaderWriter.DBObjs; + +// Dumps the retail-default keymap (gmDefaultMap @ 0x14000000) from +// client_portal.dat. Used for the Phase K control overhaul — extracts +// the canonical "default bindings" so we can ship a Retail preset +// that exactly matches what AC1 players were trained on. + +string datDir = args.Length > 0 + ? args[0] + : Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile), + "Documents", "Asheron's Call"); + +if (!Directory.Exists(datDir)) +{ + Console.Error.WriteLine($"dat dir not found: {datDir}"); + return 1; +} + +Console.WriteLine($"# Reading dats from: {datDir}"); +using var dat = new DatCollection(datDir); + +// gmDefaultMap is at 0x14000000 per DatReaderWriter test +// CanReadEORKeymaps. The test also references 0x14000002 (unnamed). +foreach (uint id in new uint[] { 0x14000000u, 0x14000002u }) +{ + Console.WriteLine(); + Console.WriteLine($"## MasterInputMap 0x{id:X8}"); + var map = dat.Get(id); + if (map is null) + { + Console.WriteLine($" (not found)"); + continue; + } + Console.WriteLine($" Name: {map.Name}"); + Console.WriteLine($" GuidMap: {map.GuidMap}"); + Console.WriteLine($" Devices: {map.Devices.Count}"); + foreach (var d in map.Devices) + { + Console.WriteLine($" {d.Type} {d.Guid}"); + } + Console.WriteLine($" MetaKeys ({map.MetaKeys.Count}):"); + foreach (var mk in map.MetaKeys) + { + var (scan, dev) = SplitKey(mk.Key); + Console.WriteLine($" {Dik(scan),-12} (scan=0x{scan:X2}, dev={dev}) ModifierFlag=0x{mk.Modifier:X8}"); + } + Console.WriteLine($" InputMaps ({map.InputMaps.Count}):"); + // Sort contexts by ID for stable output + var sortedCtx = new List(map.InputMaps.Keys); + sortedCtx.Sort(); + foreach (var ctxId in sortedCtx) + { + var inputMap = map.InputMaps[ctxId]; + Console.WriteLine(); + Console.WriteLine($" Context 0x{ctxId:X8} ({inputMap.Mappings.Count} bindings):"); + // Sort bindings by scan code for readability + var sortedBindings = new List(inputMap.Mappings); + sortedBindings.Sort((a, b) => a.Key.Key.CompareTo(b.Key.Key)); + foreach (var m in sortedBindings) + { + var (scan, dev) = SplitKey(m.Key.Key); + string mods = ModifierString(m.Key.Modifier); + Console.WriteLine( + $" {Dik(scan),-12}{(mods.Length > 0 ? "+" + mods : " ")} " + + $"(scan=0x{scan:X2}, dev={dev}) " + + $"Action=0x{m.Unknown:X8} " + + $"Activation=0x{m.Activation:X2}"); + } + } +} + +return 0; + +// ── Key decoding (scan code in high word, device id in low word) ────── +static (uint scan, uint dev) SplitKey(uint key) => ((key >> 16) & 0xFFFFu, key & 0xFFFFu); + +// ── Modifier flag bitfield ──────────────────────────────────────────── +static string ModifierString(uint flag) => + flag == 0 ? "" : string.Join("|", new[] + { + (flag & 0x80000000u) != 0 ? "Shift" : null, + (flag & 0x40000000u) != 0 ? "Ctrl" : null, + (flag & 0x20000000u) != 0 ? "Alt" : null, + (flag & 0x10000000u) != 0 ? "Win" : null, + (flag & 0x08000000u) != 0 ? "Meta4" : null, + (flag & 0x04000000u) != 0 ? "Meta5" : null, + }.Where(s => s is not null)); + +// ── DirectInput scan-code → name (DIK_*) ────────────────────────────── +// +// Verified subset against acclient_2013_pseudo_c.txt +// ControlNameMapper::AddKeySemantic calls (lines 656172-656272). Rest +// from standard Microsoft DirectInput dinput.h DIK_* table. +static string Dik(uint code) => code switch +{ + 0x01 => "ESCAPE", + 0x02 => "1", 0x03 => "2", 0x04 => "3", 0x05 => "4", 0x06 => "5", + 0x07 => "6", 0x08 => "7", 0x09 => "8", 0x0a => "9", 0x0b => "0", + 0x0c => "MINUS", 0x0d => "EQUALS", 0x0e => "BACK", 0x0f => "TAB", + 0x10 => "Q", 0x11 => "W", 0x12 => "E", 0x13 => "R", 0x14 => "T", + 0x15 => "Y", 0x16 => "U", 0x17 => "I", 0x18 => "O", 0x19 => "P", + 0x1a => "LBRACKET", 0x1b => "RBRACKET", 0x1c => "RETURN", 0x1d => "LCONTROL", + 0x1e => "A", 0x1f => "S", 0x20 => "D", 0x21 => "F", 0x22 => "G", + 0x23 => "H", 0x24 => "J", 0x25 => "K", 0x26 => "L", + 0x27 => "SEMICOLON", 0x28 => "APOSTROPHE", 0x29 => "GRAVE", + 0x2a => "LSHIFT", 0x2b => "BACKSLASH", + 0x2c => "Z", 0x2d => "X", 0x2e => "C", 0x2f => "V", 0x30 => "B", + 0x31 => "N", 0x32 => "M", 0x33 => "COMMA", 0x34 => "PERIOD", + 0x35 => "SLASH", 0x36 => "RSHIFT", 0x37 => "MULTIPLY", + 0x38 => "LMENU", 0x39 => "SPACE", 0x3a => "CAPITAL", + 0x3b => "F1", 0x3c => "F2", 0x3d => "F3", 0x3e => "F4", 0x3f => "F5", + 0x40 => "F6", 0x41 => "F7", 0x42 => "F8", 0x43 => "F9", 0x44 => "F10", + 0x45 => "NUMLOCK", 0x46 => "SCROLL", + 0x47 => "NUMPAD7", 0x48 => "NUMPAD8", 0x49 => "NUMPAD9", + 0x4a => "SUBTRACT", + 0x4b => "NUMPAD4", 0x4c => "NUMPAD5", 0x4d => "NUMPAD6", + 0x4e => "ADD", + 0x4f => "NUMPAD1", 0x50 => "NUMPAD2", 0x51 => "NUMPAD3", + 0x52 => "NUMPAD0", 0x53 => "DECIMAL", + 0x57 => "F11", 0x58 => "F12", + 0x9c => "NUMPADENTER", 0x9d => "RCONTROL", + 0xb5 => "DIVIDE", 0xb7 => "SYSRQ", 0xb8 => "RMENU", + 0xc7 => "HOME", 0xc8 => "UP", 0xc9 => "PRIOR" /*PgUp*/, + 0xcb => "LEFT", 0xcd => "RIGHT", + 0xcf => "END", 0xd0 => "DOWN", 0xd1 => "NEXT" /*PgDn*/, + 0xd2 => "INSERT", 0xd3 => "DELETE", + _ => $"?0x{code:X2}", +}; + +// ── Action ID → name ────────────────────────────────────────────────── +// +// Extracted verbatim from acclient_2013_pseudo_c.txt +// command_strings table at 0x00803df0 (lines 1067906-1068117). +// Subset — covers indices 0x000-0x0d5; the rest are mostly emote +// variants (Cheer, ChestBeat, FallDown, etc.) we don't need for +// keymap analysis. +static string Action(uint id) => id switch +{ + 0x000 => "Invalid", + 0x001 => "HoldRun", + 0x002 => "HoldSidestep", + 0x003 => "Ready", + 0x004 => "Stop", + 0x005 => "WalkForward", + 0x006 => "WalkBackwards", + 0x007 => "RunForward", + 0x008 => "Fallen", + 0x009 => "Interpolating", + 0x00a => "Hover", + 0x00d => "TurnRight", + 0x00e => "TurnLeft", + 0x00f => "SideStepRight", + 0x010 => "SideStepLeft", + 0x011 => "Dead", + 0x012 => "Crouch", + 0x013 => "Sitting", + 0x014 => "Sleeping", + 0x015 => "Falling", + 0x018 => "Pickup", + 0x01d => "JumpCharging", + 0x03b => "Jump", + 0x03c => "HandCombat", + 0x03d => "NonCombat", + 0x0a2 => "Cancel", + 0x0a3 => "UseSelected", + 0x0a4 => "AutosortSelected", + 0x0a5 => "DropSelected", + 0x0a6 => "GiveSelected", + 0x0a7 => "SplitSelected", + 0x0a8 => "ExamineSelected", + 0x0a9 => "CreateShortcutToSelected", + 0x0aa => "PreviousCompassItem", + 0x0ab => "NextCompassItem", + 0x0ac => "ClosestCompassItem", + 0x0ad => "PreviousSelection", + 0x0ae => "LastAttacker", + 0x0af => "PreviousFellow", + 0x0b0 => "NextFellow", + 0x0b1 => "ToggleCombat", + 0x0b2 => "HighAttack", + 0x0b3 => "MediumAttack", + 0x0b4 => "LowAttack", + 0x0b5 => "EnterChat", + 0x0b6 => "ToggleChat", + 0x0b7 => "SavePosition", + 0x0b8 => "OptionsPanel", + 0x0b9 => "ResetView", + 0x0ba => "CameraLeftRotate", + 0x0bb => "CameraRightRotate", + 0x0bc => "CameraRaise", + 0x0bd => "CameraLower", + 0x0be => "CameraCloser", + 0x0bf => "CameraFarther", + 0x0c0 => "FloorView", + 0x0c1 => "MouseLook", + 0x0c2 => "PreviousItem", + 0x0c3 => "NextItem", + 0x0c4 => "ClosestItem", + 0x0c5 => "ShiftView", + 0x0c6 => "MapView", + 0x0c7 => "AutoRun", + 0x0c8 => "DecreasePowerSetting", + 0x0c9 => "IncreasePowerSetting", + 0x0d3 => "CastSpell", + 0x0d5 => "FirstPersonView", + _ => $"?0x{id:X4}", +}; diff --git a/tools/dump-keymap/dump-keymap.csproj b/tools/dump-keymap/dump-keymap.csproj new file mode 100644 index 0000000..0f37cbb --- /dev/null +++ b/tools/dump-keymap/dump-keymap.csproj @@ -0,0 +1,13 @@ + + + Exe + net10.0 + enable + latest + DumpKeymap + + + + + + diff --git a/tools/dump-keymap/dump.txt b/tools/dump-keymap/dump.txt new file mode 100644 index 0000000..53bf4b2 --- /dev/null +++ b/tools/dump-keymap/dump.txt @@ -0,0 +1,262 @@ +C:\Users\erikn\source\repos\acdream\tools\dump-keymap\Program.cs(142,15): warning CS8321: The local function 'Action' is declared but never used [C:\Users\erikn\source\repos\acdream\tools\dump-keymap\dump-keymap.csproj] +# Reading dats from: C:\Users\erikn\Documents\Asheron's Call + +## MasterInputMap 0x14000000 + Name: gmDefaultMap + GuidMap: 451f8ccc-a7e9-4df4-9a6b-f4a7c706f300 + Devices: 2 + Keyboard 6f1d2b61-d5a0-11cf-bfc7-444553540000 + Mouse 6f1d2b60-d5a0-11cf-bfc7-444553540000 + MetaKeys (9): + LSHIFT (scan=0x2A, dev=0) ModifierFlag=0x80000000 + LCONTROL (scan=0x1D, dev=0) ModifierFlag=0x40000000 + RCONTROL (scan=0x9D, dev=0) ModifierFlag=0x40000000 + LMENU (scan=0x38, dev=0) ModifierFlag=0x20000000 + RMENU (scan=0xB8, dev=0) ModifierFlag=0x20000000 + ?0xDB (scan=0xDB, dev=0) ModifierFlag=0x10000000 + ?0xDC (scan=0xDC, dev=0) ModifierFlag=0x10000000 + TAB (scan=0x0F, dev=1) ModifierFlag=0x08000000 + Q (scan=0x10, dev=1) ModifierFlag=0x04000000 + InputMaps (14): + + Context 0x00000004 (22 bindings): + Q (scan=0x10, dev=0) Action=0x00000030 Activation=0x03 + W (scan=0x11, dev=0) Action=0x00000029 Activation=0x03 + Y (scan=0x15, dev=0) Action=0x10000094 Activation=0x03 + A +Alt (scan=0x1E, dev=0) Action=0x0000002D Activation=0x03 + A (scan=0x1E, dev=0) Action=0x0000002F Activation=0x03 + S (scan=0x1F, dev=0) Action=0x0000002B Activation=0x03 + D (scan=0x20, dev=0) Action=0x0000002E Activation=0x03 + D +Alt (scan=0x20, dev=0) Action=0x0000002C Activation=0x03 + G (scan=0x22, dev=0) Action=0x10000096 Activation=0x03 + H (scan=0x23, dev=0) Action=0x10000095 Activation=0x03 + LSHIFT (scan=0x2A, dev=0) Action=0x00000032 Activation=0x03 + Z (scan=0x2C, dev=0) Action=0x0000002D Activation=0x03 + X (scan=0x2D, dev=0) Action=0x0000002A Activation=0x03 + C (scan=0x2E, dev=0) Action=0x0000002C Activation=0x03 + B (scan=0x30, dev=0) Action=0x10000097 Activation=0x03 + SPACE (scan=0x39, dev=0) Action=0x00000031 Activation=0x03 + UP (scan=0xC8, dev=0) Action=0x00000029 Activation=0x03 + LEFT +Alt (scan=0xCB, dev=0) Action=0x0000002D Activation=0x03 + LEFT (scan=0xCB, dev=0) Action=0x0000002F Activation=0x03 + RIGHT (scan=0xCD, dev=0) Action=0x0000002E Activation=0x03 + RIGHT +Alt (scan=0xCD, dev=0) Action=0x0000002C Activation=0x03 + DOWN (scan=0xD0, dev=0) Action=0x0000002A Activation=0x03 + + Context 0x00000005 (2 bindings): + F2 (scan=0x3C, dev=0) Action=0x0000003E Activation=0x03 + DIVIDE (scan=0xB5, dev=0) Action=0x0000003E Activation=0x03 + + Context 0x00000006 (4 bindings): + UP (scan=0xC8, dev=0) Action=0x00000037 Activation=0x03 + LEFT (scan=0xCB, dev=0) Action=0x00000035 Activation=0x03 + RIGHT (scan=0xCD, dev=0) Action=0x00000036 Activation=0x03 + DOWN (scan=0xD0, dev=0) Action=0x00000038 Activation=0x03 + + Context 0x10000002 (1 bindings): + GRAVE (scan=0x29, dev=0) Action=0x1000005A Activation=0x03 + + Context 0x10000003 (5 bindings): + PRIOR (scan=0xC9, dev=0) Action=0x1000005C Activation=0x03 + END (scan=0xCF, dev=0) Action=0x1000005E Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x1000005F Activation=0x03 + INSERT (scan=0xD2, dev=0) Action=0x1000005B Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x1000005D Activation=0x03 + + Context 0x10000004 (5 bindings): + PRIOR (scan=0xC9, dev=0) Action=0x100000F0 Activation=0x03 + END (scan=0xCF, dev=0) Action=0x100000F2 Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x100000F3 Activation=0x03 + INSERT (scan=0xD2, dev=0) Action=0x100000EF Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x100000F1 Activation=0x03 + + Context 0x10000005 (18 bindings): + 1 (scan=0x02, dev=0) Action=0x10000065 Activation=0x03 + 2 (scan=0x03, dev=0) Action=0x10000066 Activation=0x03 + 3 (scan=0x04, dev=0) Action=0x10000067 Activation=0x03 + 4 (scan=0x05, dev=0) Action=0x10000068 Activation=0x03 + 5 (scan=0x06, dev=0) Action=0x10000069 Activation=0x03 + 6 (scan=0x07, dev=0) Action=0x1000006A Activation=0x03 + 7 (scan=0x08, dev=0) Action=0x1000006B Activation=0x03 + 8 (scan=0x09, dev=0) Action=0x1000006C Activation=0x03 + 9 (scan=0x0A, dev=0) Action=0x1000006D Activation=0x03 + PRIOR (scan=0xC9, dev=0) Action=0x10000064 Activation=0x03 + PRIOR +Ctrl (scan=0xC9, dev=0) Action=0x10000105 Activation=0x03 + END (scan=0xCF, dev=0) Action=0x10000060 Activation=0x03 + NEXT +Ctrl (scan=0xD1, dev=0) Action=0x10000103 Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x10000062 Activation=0x03 + INSERT +Ctrl (scan=0xD2, dev=0) Action=0x10000104 Activation=0x03 + INSERT (scan=0xD2, dev=0) Action=0x10000063 Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x10000061 Activation=0x03 + DELETE +Ctrl (scan=0xD3, dev=0) Action=0x10000102 Activation=0x03 + + Context 0x10000006 (5 bindings): + U (scan=0x16, dev=0) Action=0x100000A7 Activation=0x03 + I (scan=0x17, dev=0) Action=0x100000B2 Activation=0x03 + O (scan=0x18, dev=0) Action=0x100000A2 Activation=0x03 + J (scan=0x24, dev=0) Action=0x100000E5 Activation=0x03 + K (scan=0x25, dev=0) Action=0x100000BE Activation=0x03 + + Context 0x10000007 (18 bindings): + MINUS (scan=0x0C, dev=0) Action=0x10000030 Activation=0x03 + EQUALS (scan=0x0D, dev=0) Action=0x10000031 Activation=0x03 + BACK (scan=0x0E, dev=0) Action=0x1000002F Activation=0x03 + T (scan=0x14, dev=0) Action=0x1000002D Activation=0x03 + P (scan=0x19, dev=0) Action=0x1000002E Activation=0x03 + LBRACKET (scan=0x1A, dev=0) Action=0x10000033 Activation=0x03 + RBRACKET (scan=0x1B, dev=0) Action=0x10000034 Activation=0x03 + F (scan=0x21, dev=0) Action=0x1000002C Activation=0x03 + L (scan=0x26, dev=0) Action=0x10000036 Activation=0x03 + SEMICOLON (scan=0x27, dev=0) Action=0x10000037 Activation=0x03 + APOSTROPHE (scan=0x28, dev=0) Action=0x10000035 Activation=0x03 + BACKSLASH (scan=0x2B, dev=0) Action=0x10000032 Activation=0x03 + N (scan=0x31, dev=0) Action=0x1000003C Activation=0x03 + M (scan=0x32, dev=0) Action=0x1000003D Activation=0x03 + COMMA (scan=0x33, dev=0) Action=0x1000003A Activation=0x03 + PERIOD (scan=0x34, dev=0) Action=0x1000003B Activation=0x03 + SLASH (scan=0x35, dev=0) Action=0x10000039 Activation=0x03 + HOME (scan=0xC7, dev=0) Action=0x10000038 Activation=0x03 + + Context 0x10000009 (20 bindings): + ESCAPE +Shift (scan=0x01, dev=0) Action=0x10000026 Activation=0x03 + ESCAPE (scan=0x01, dev=0) Action=0x00000027 Activation=0x03 + 1 +Alt (scan=0x02, dev=0) Action=0x10000114 Activation=0x03 + 2 +Alt (scan=0x03, dev=0) Action=0x10000115 Activation=0x03 + 3 +Alt (scan=0x04, dev=0) Action=0x10000116 Activation=0x03 + 4 +Alt (scan=0x05, dev=0) Action=0x10000117 Activation=0x03 + E (scan=0x12, dev=0) Action=0x1000002B Activation=0x03 + R (scan=0x13, dev=0) Action=0x10000025 Activation=0x03 + MULTIPLY (scan=0x37, dev=0) Action=0x00000055 Activation=0x03 + F1 +Shift|Ctrl (scan=0x3B, dev=0) Action=0x0000007C Activation=0x03 + F1 (scan=0x3B, dev=0) Action=0x0000007B Activation=0x03 + F3 (scan=0x3D, dev=0) Action=0x1000000E Activation=0x03 + F4 (scan=0x3E, dev=0) Action=0x1000000F Activation=0x03 + F5 (scan=0x3F, dev=0) Action=0x10000011 Activation=0x03 + F6 (scan=0x40, dev=0) Action=0x10000012 Activation=0x03 + F8 (scan=0x42, dev=0) Action=0x10000014 Activation=0x03 + F9 (scan=0x43, dev=0) Action=0x10000015 Activation=0x03 + F10 (scan=0x44, dev=0) Action=0x10000016 Activation=0x03 + F11 (scan=0x57, dev=0) Action=0x1000001A Activation=0x03 + F12 (scan=0x58, dev=0) Action=0x10000019 Activation=0x03 + + Context 0x1000000A (1 bindings): + RETURN (scan=0x1C, dev=0) Action=0x10000023 Activation=0x03 + + Context 0x1000000B (2 bindings): + MINUS (scan=0x0C, dev=1) Action=0x00000007 Activation=0x03 + EQUALS (scan=0x0D, dev=1) Action=0x00000008 Activation=0x03 + + Context 0x1000000C (29 bindings): + 1 (scan=0x02, dev=0) Action=0x10000042 Activation=0x03 + 1 +Alt (scan=0x02, dev=0) Action=0x1000004B Activation=0x03 + 1 +Ctrl (scan=0x02, dev=0) Action=0x10000042 Activation=0x03 + 2 (scan=0x03, dev=0) Action=0x10000043 Activation=0x03 + 2 +Alt (scan=0x03, dev=0) Action=0x1000004C Activation=0x03 + 2 +Ctrl (scan=0x03, dev=0) Action=0x10000043 Activation=0x03 + 3 (scan=0x04, dev=0) Action=0x10000044 Activation=0x03 + 3 +Ctrl (scan=0x04, dev=0) Action=0x10000044 Activation=0x03 + 3 +Alt (scan=0x04, dev=0) Action=0x1000004D Activation=0x03 + 4 (scan=0x05, dev=0) Action=0x10000045 Activation=0x03 + 4 +Ctrl (scan=0x05, dev=0) Action=0x10000045 Activation=0x03 + 4 +Alt (scan=0x05, dev=0) Action=0x10000132 Activation=0x03 + 5 (scan=0x06, dev=0) Action=0x10000046 Activation=0x03 + 5 +Ctrl (scan=0x06, dev=0) Action=0x10000046 Activation=0x03 + 5 +Alt (scan=0x06, dev=0) Action=0x10000133 Activation=0x03 + 6 +Ctrl (scan=0x07, dev=0) Action=0x10000047 Activation=0x03 + 6 +Alt (scan=0x07, dev=0) Action=0x10000134 Activation=0x03 + 6 (scan=0x07, dev=0) Action=0x10000047 Activation=0x03 + 7 +Alt (scan=0x08, dev=0) Action=0x10000135 Activation=0x03 + 7 (scan=0x08, dev=0) Action=0x10000048 Activation=0x03 + 7 +Ctrl (scan=0x08, dev=0) Action=0x10000048 Activation=0x03 + 8 (scan=0x09, dev=0) Action=0x10000049 Activation=0x03 + 8 +Ctrl (scan=0x09, dev=0) Action=0x10000049 Activation=0x03 + 8 +Alt (scan=0x09, dev=0) Action=0x10000136 Activation=0x03 + 9 +Alt (scan=0x0A, dev=0) Action=0x10000137 Activation=0x03 + 9 +Ctrl (scan=0x0A, dev=0) Action=0x1000004A Activation=0x03 + 9 (scan=0x0A, dev=0) Action=0x1000004A Activation=0x03 + 0 (scan=0x0B, dev=0) Action=0x1000010D Activation=0x03 + 0 +Ctrl (scan=0x0B, dev=0) Action=0x1000010D Activation=0x03 + + Context 0x1000000D (1 bindings): + TAB (scan=0x0F, dev=0) Action=0x10000024 Activation=0x03 + +## MasterInputMap 0x14000002 + Name: DefaultMap + GuidMap: 451f8ccc-a7e9-4df4-9a6b-f4a7c706f300 + Devices: 2 + Keyboard 6f1d2b61-d5a0-11cf-bfc7-444553540000 + Mouse 6f1d2b60-d5a0-11cf-bfc7-444553540000 + MetaKeys (7): + LSHIFT (scan=0x2A, dev=0) ModifierFlag=0x80000000 + LCONTROL (scan=0x1D, dev=0) ModifierFlag=0x40000000 + RCONTROL (scan=0x9D, dev=0) ModifierFlag=0x40000000 + LMENU (scan=0x38, dev=0) ModifierFlag=0x20000000 + RMENU (scan=0xB8, dev=0) ModifierFlag=0x20000000 + ?0xDB (scan=0xDB, dev=0) ModifierFlag=0x10000000 + ?0xDC (scan=0xDC, dev=0) ModifierFlag=0x10000000 + InputMaps (7): + + Context 0x00000003 (8 bindings): + ?0x00 (scan=0x00, dev=1) Action=0x00000002 Activation=0x80 + 3 (scan=0x04, dev=1) Action=0x00000003 Activation=0x80 + MINUS (scan=0x0C, dev=1) Action=0x00000007 Activation=0x03 + MINUS (scan=0x0C, dev=1) Action=0x0000000A Activation=0x60 + EQUALS (scan=0x0D, dev=1) Action=0x00000008 Activation=0x03 + EQUALS (scan=0x0D, dev=1) Action=0x0000000B Activation=0x60 + BACK (scan=0x0E, dev=1) Action=0x00000009 Activation=0x03 + BACK (scan=0x0E, dev=1) Action=0x0000000C Activation=0x60 + + Context 0x00000005 (11 bindings): + BACK (scan=0x0E, dev=1) Action=0x0000003D Activation=0x03 + NUMPAD8 (scan=0x48, dev=0) Action=0x00000037 Activation=0x03 + SUBTRACT (scan=0x4A, dev=0) Action=0x00000033 Activation=0x03 + NUMPAD4 (scan=0x4B, dev=0) Action=0x00000035 Activation=0x03 + NUMPAD5 (scan=0x4C, dev=0) Action=0x0000003B Activation=0x03 + NUMPAD6 (scan=0x4D, dev=0) Action=0x00000036 Activation=0x03 + ADD (scan=0x4E, dev=0) Action=0x00000034 Activation=0x03 + NUMPAD2 (scan=0x50, dev=0) Action=0x00000038 Activation=0x03 + NUMPAD0 (scan=0x52, dev=0) Action=0x00000039 Activation=0x03 + DECIMAL (scan=0x53, dev=0) Action=0x0000003A Activation=0x03 + NUMPADENTER (scan=0x9C, dev=0) Action=0x0000003C Activation=0x03 + + Context 0x00000007 (16 bindings): + ESCAPE (scan=0x01, dev=0) Action=0x00000027 Activation=0x03 + BACK (scan=0x0E, dev=0) Action=0x00000028 Activation=0x03 + RETURN (scan=0x1C, dev=0) Action=0x00000025 Activation=0x03 + HOME (scan=0xC7, dev=0) Action=0x0000001A Activation=0x03 + HOME +Ctrl (scan=0xC7, dev=0) Action=0x0000001C Activation=0x03 + UP (scan=0xC8, dev=0) Action=0x0000001E Activation=0x03 + PRIOR (scan=0xC9, dev=0) Action=0x00000020 Activation=0x03 + LEFT (scan=0xCB, dev=0) Action=0x00000016 Activation=0x03 + LEFT +Ctrl (scan=0xCB, dev=0) Action=0x00000018 Activation=0x03 + RIGHT (scan=0xCD, dev=0) Action=0x00000017 Activation=0x03 + RIGHT +Ctrl (scan=0xCD, dev=0) Action=0x00000019 Activation=0x03 + END (scan=0xCF, dev=0) Action=0x0000001B Activation=0x03 + END +Ctrl (scan=0xCF, dev=0) Action=0x0000001D Activation=0x03 + DOWN (scan=0xD0, dev=0) Action=0x0000001F Activation=0x03 + NEXT (scan=0xD1, dev=0) Action=0x00000021 Activation=0x03 + DELETE (scan=0xD3, dev=0) Action=0x00000026 Activation=0x03 + + Context 0x00000008 (6 bindings): + X +Ctrl (scan=0x2D, dev=0) Action=0x00000023 Activation=0x03 + C +Ctrl (scan=0x2E, dev=0) Action=0x00000022 Activation=0x03 + V +Ctrl (scan=0x2F, dev=0) Action=0x00000024 Activation=0x03 + INSERT +Ctrl (scan=0xD2, dev=0) Action=0x00000022 Activation=0x03 + INSERT +Shift (scan=0xD2, dev=0) Action=0x00000024 Activation=0x03 + DELETE +Shift (scan=0xD3, dev=0) Action=0x00000023 Activation=0x03 + + Context 0x00000009 (2 bindings): + ESCAPE (scan=0x01, dev=0) Action=0x00000027 Activation=0x03 + RETURN (scan=0x1C, dev=0) Action=0x00000025 Activation=0x03 + + Context 0x0000000A (4 bindings): + 7 (scan=0x08, dev=257) Action=0x00000005 Activation=0x03 + 7 (scan=0x08, dev=513) Action=0x00000006 Activation=0x03 + UP +Ctrl (scan=0xC8, dev=0) Action=0x00000005 Activation=0x03 + DOWN +Ctrl (scan=0xD0, dev=0) Action=0x00000006 Activation=0x03 + + Context 0x00000010 (4 bindings): + ESCAPE +Shift|Ctrl (scan=0x01, dev=0) Action=0x0000007F Activation=0x03 + TAB +Alt (scan=0x0F, dev=0) Action=0x00000053 Activation=0x03 + RETURN +Alt (scan=0x1C, dev=0) Action=0x0000007D Activation=0x03 + F4 +Alt (scan=0x3E, dev=0) Action=0x0000007E Activation=0x03