User:Taz/Scratchpad-lotro.keymap Reference

From Lotro-Wiki.com
Jump to navigation Jump to search

lotro.keymap Reference

The LotRO game client stores keybindings in the lotro.keymap file in the game's preferences folder. If this file is missing when the game client starts, one with default contents will be created.

Most players will change keybindings on the game client's Options/Keymapping panel. Changes made in-game will update this file as they are made, and the file will be rewritten when the game client closes.

Copying this file from one computer to another is often enough to recreate a custom keymap on the second system.

The key bindings associate keypresses with in-game actions, such as opening a window or using an object. The action names (referred to herein as "function names") can be used by plugins to sense the associated keypresses via KeyUp and KeyDown events[1].


File Locations

  • PC client: %USERPROFILE%\Documents\The Lord of the Rings Online\lotro.keymap
  • PC client under WINE: ~/Documents/The Lord of the Rings Online/lotro.keymap
  • Mac Client: ~/Library/Application Support/com.turbine.lotroclient/lotro.keymap


Editing (Handle with Care)

Use the game client's Options/Keymapping panel to set keybindings whenever possible. Unfortunately, some changes cannot be made with the options panel. If you must edit this file by hand:

1. copy the file to a backup location (eg lotro.keymap.backup)
2. copy the file to a new name for editing (eg lotro.keymap.changes)
3. edit with Notepad or your favourite text editor
4. while the game client is closed, copy the changed file to the original location (lotro.keymap)
5. start the game client and test your changes

If the game doesn't accept all of the changes, compare the live version to the attempted changes to help find syntax mistakes or other issues. You can always copy the lotro.keymap.backup file to lotro.keymap to restore the earlier version.

lotro.keymap File Layout

The keymap file is well commented regarding its subsections and keybinding syntax. As a brief overview:

1. Devices: gives each input device an index for reference in later sections.
2. MetaKeys: assigns each modifier key (shift, ctrl, alt, etc) an index in a bitfield for reference in keybinding sections.
3. Bindings:
a. Main: primary game functions. Most of the functions configurable ingame through the Options/Keymapping panel are in this subsection.
b. EditControls: typical cursor-movement functions for text input (search fields, biography, chat window, etc).
c. SelectionUI: (?)
d. MusicUI: music playing functions.
e. MapPanel: (empty)
f. VendorBuyUI: functions for purchasing multiple items at a vendor.
g. ScrollableControls: (empty)
h. ScrollableControls_Mouse: page-scrolling functions.
i. CopyAndPasteControls: typical Ctrl-C, Ctrl-X, Ctrl-V support functions for text input.
j. DialogBoxes: (?) (seems to be for moving input focus between in-game panels, but unknown if this is functional. perhaps in-game browser?)
k. DebugConsole: (?) (suspect inactive in live game client)
l. StringTokenDebugger: (?) (suspect inactive in live game client)

The following will touch on each of the main sections. Comment lines from the lotro.keymap file are included to provide context to the breakdown for each section.


Devices

This section of the file is a simple list of devices that can be referenced in later sections. The keyboard is always device 0 and the mouse is always device 1; they do not need to be listed. Other devices are indexed in the order listed in this section.


MetaKeys

MetaKeys are the modifier keys used in a keybinding. The MetaKeys section itself defines the modifier's value by it's location in a bitfield. In the Bindings section, the combination of values for all modifiers used in a binding gives the MetaKeyValue. MetaKeyValues are in hexadecimal.


Syntax Reference


Default MetaKeys

The following table shows the default MetaKey bit location assignments and their corresponding values, and provides examples of user-defined MetaKeys.


MetaKeyValue Examples

The following table shows the resulting MetaKeyValues for each combination of the default keyboard MetaKeys.


Bindings

The Bindings section of the lotro.keymap file is where individual keybindings are defined. Each subsection consists of a number of lines that map a control combination to a function.

  • Generally, control combinations must be unique within a subsection, but the same control combination can be reused in other subsections. For example, the Shift+1 control is used for Quickslot 37 in the Main subsection, and again for Note C4 in the Music subsection.
  • Functions can be used multiple times within a subsection as long as the control combinations differ. For example, Note C4 in the Music subsection is bound once to 8 and again to Shift+1.


Basic Syntax

The basic syntax of a binding is:

 Function [ <Status> [ <Device> <KeyIndex> ] <MetaKeyValue> ]

MetaKeyValue is optional; the other parts are required. As examples, here are the default bindings for move forward (W), which uses no MetaKeyValue, and toggle lantern (Alt+F10):

 MovementForward [ Old [ 0 DIK_W ] ]
 ADMIN_LIGHT [ Old [ 0 DIK_F10 ] 0x00000004 ]


A more complete syntax looks like the following. SubControl, MetaKeyValue, and ActivationType are all optional.

 Function [ <Status> [ <Device> <KeyIndex> <SubControl> ] <MetaKeyValue> <ActivationType> ]

Here are two default bindings for zoom out (mousewheel down) showing SubControl, and a selection function (mouse button0 doubleclick) showing ActivationType use:

 CameraInstantMoveAway [ Old [ 1 DIMOFS_Z AxisNegative ] ]
 SelectDblLeft [ Old [ 1 DIMOFS_BUTTON0 ] 0x00000000 MouseDblClick ]


Syntax Reference


Function Reference

In-Game Accessible Functions

The following tables map the labels in the game client's Options/Keymapping panel to function names in the keymap file. They are presented in the panel's ordering.


Manually Configured Functions

These are keybind functions that can only be changed by editing the lotro.keymap file manually. The game client does not provide access to them within the Options/Keymapping UI.

You can, however, disable or reassign the bound keys within the game client, by assigning the key to an in-game-accessible function. This assignment can be cleared afterward to effectively disable the original keybind.


Inactive (Debugging) Functions

These function entries appear to be disabled in the live game client. They may be functional in development builds such as the Bullroarer client. They are listed here with their default keybinds for completeness.