v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Interface.txt

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{migrated article}}
+
{{Quality|Superior|20:29, 30 April 2013 (UTC)}}
{{Quality|Unrated}}
 
 
{{av}}
 
{{av}}
 
{{file|DF/data/init/interface.txt}}
 
{{file|DF/data/init/interface.txt}}
: ''See [[Controls]] for the default key binds.''
+
See [[Controls]] for the default key binds.
 
+
__TOC__
 +
==Key bindings==
 
'''Key bindings''' determine how the game responds to the user (you) pressing different keys on their keyboard, numberpad, laptop, whatever.  
 
'''Key bindings''' determine how the game responds to the user (you) pressing different keys on their keyboard, numberpad, laptop, whatever.  
  
The game key bindings are stored in '''interface.txt'''. They can be configured in the {{DFtext|Key Bindings}} section of the in-game options screen or by editing this file directly.  
+
To access the key bindings, start a game(or just edit [[Interface.txt#Vanilla interface.txt|interface.txt]]), then hit {{k|Esc}} - using the up/down arrows, highlight "Key Bindings" and hit {{k|Enter}}.  This then shows the various game mode/screen categories (and [[Macros]]) selecting one shows all of the bindable game commands in that category.
  
Each action can be bound to any number of keys, either by keyboard location or letter. They can also be given a repeat style which specified what happens when any of the bound keys are held:
+
On the left you see you see list of bindable commands and on the right side you see "Add binding" option the "Don't repeat", "Delayed repeat" and "Immediate repeat" after that refer to what happens when you hold down the key, the one in red is selected and finally the ones starting with "By position:  " and "By letter:  " are the currently set binds of the command.
  
{| class="wikitable"
+
For example if you wanted to add {{k|9}} to "Select" command(odd, but your choice) you would then select the General category, press right on the first command(Select) and hit {{k|Enter}} on the "Add binding" option to open a key registration prompt and then press {{k|9}} and select whether you want to bind [[#Differences_between_KEY_and_SYM|by position or by key]] and hit {{k|Enter}} or if you hit the wrong button {{k|Esc}}(or whatever you have set to "Main menu" or "Leave screen" keys) to abort. However, you'd then have to find any action that '''also''' is controlled by  {{k|9}}, or you'll be sending '''both''' commands every time you hit that key. Changes should be planned carefully with that last in mind. To remove the command you added select the "By letter: 9" or "By position: 9" or "By position: Numpad 9" on the select command with arrow keys and press backspace (your "String: Backspace" key) to delete the keybind.
|-
 
! Repeat Style
 
! Behavior
 
|-
 
| Don't repeat
 
| The action does not repeat at all; pressing the key performs the action exactly once, no matter how long it is held.
 
|-
 
| Delayed repeat
 
| The action repeats after a delay of [[DF2014:Technical_tricks#Keyboard|<code>KEY_HOLD_MS</code>]] milliseconds.
 
|-
 
| Immediate repeat
 
| The action repeats immediately.
 
|}
 
  
== Changing key bindings in-game==
+
Additional commands can be viewed by scrolling using the up/down arrows, or by screen using the page up/page down keys (unless you've changed those).
When in-game, press {{k|Esc}} to open the options screen and select {{DFtext|Key Bindings}}. This shows the various game mode/screen categories (and [[Macros]]).
 
  
Selecting one shows all of the bindable game commands in that category. On the left is a list of bindable commands and on the right are options to add bindings and change the action's repeat style. Use the left and right selection keys to move between them.
+
==Additional Up/Down Z-Level Keys==
  
Use {{k|Backspace}} on a binding to remove it.
+
One of the more common key binding changes, is to use the comma {{k|,}} and period {{k|.}}, rather than {{k|<}} and {{k|>}} (the same keys + {{k|Shift}}) for up/down [[z-level]]s, thus avoiding the need to use two hands/keys for this common action.  
  
For example if you wanted to add {{k|9}} to "Select" command (odd, but your choice) you would then select the General category, press right on the first command(Select) and hit {{k|Enter}} on the "Add binding" option to open a key registration prompt and then press {{k|9}} and select whether you want to bind [[#Differences_between_KEY_and_SYM|by position or by key]] and hit {{k|Enter}} or if you hit the wrong button {{k|Esc}} (or whatever you have set to "Main menu" or "Leave screen" keys) to abort.
+
You'll need to add the following in the general category.
  
Adding bindings does not remove any other binding that also uses this key. This is almost never what you want, so you'd then have to find any command that is also bound to your added key, or you'll be sending both commands every time.
+
Move view/cursor up (z)                By position/letter: ,
 +
Move view/cursor down (z)              By position/letter: .
  
== Useful custom bindings ==
+
''Then, also '''be sure''' remove'' the following entry from the dwarf mode,
  
===Scrolling without keypad===
+
Main: One-Step                          By letter: .
  
If you're on a laptop or using a restricted keyboard, using {{k|+}} and {{k|*}} to scroll on some menus is inconvenient since it requires the Shift key. To scroll with <code>-=[]</code> instead of <code>-+/*</code>, add:
+
This avoids advancing the game one [[Frames per second|step]] each time you move the game view "down" one [[z-level]], since both would be controlled by the {{k|.}} key.  But advancing one step would become unbound so you could use {{k|<}} or {{k|>}} or any other '''unused''' key for that.
  
{| class="wikitable"
 
|-
 
! Category !! Command !! Key
 
|-
 
| General || Move secondary selector down || {{k|<nowiki>=</nowiki>}}
 
|-
 
| General || Page secondary selector up || {{k|[}}
 
|-
 
| General || Page secondary selector down || {{k|]}}
 
|}
 
  
===Change z-level without shift===
+
Some players may feel more comfortable by switching the PgDn/PgUp keys to control moving between z-levels, though this is not recommended should you use the numpad for movement.
  
You can use the comma {{k|,}} and period {{k|.}}, rather than {{k|<}} and {{k|>}} (the same keys + {{k|Shift}}) for up/down [[z-level]]s, thus avoiding the need to use two hands/keys for this common action.
+
== Laptop Bindings ==
 +
[[40d:Key_bindings#Laptop Bindings|40d version]] required some editing to use non-numpad versions of keys but this is no longer necessary so there are no longer any changes possible that could make laptop keyboards easier to use for playing DF.
  
Add the following:
+
== Vanilla interface.txt ==
  
{| class="wikitable"
 
|-
 
! Category !! Command !! Key
 
|-
 
| General || Move view/cursor up (z) || {{k|,}}
 
|-
 
| General || Move view/cursor down (z) || {{k|.}}
 
|}
 
 
Then remove the following to avoid clashing:
 
 
{| class="wikitable"
 
|-
 
! Category !! Command !! Key
 
|-
 
| Dwarf mode || Main: One-Step || {{k|.}}
 
|}
 
 
== interface.txt ==
 
The file can be found in <code>Dwarf Fortress\data\init\interface.txt</code>
 
 
=== Default settings ===
 
 
{{gamedata}}
 
{{gamedata}}
  
=== Key syntax ===
+
== Key syntax ==
 
A key bindings block has this structure:
 
A key bindings block has this structure:
 
<pre>
 
<pre>
Line 95: Line 51:
 
*And the <code>SYM/KEY</code> part, which defines which key the action is mapped to.
 
*And the <code>SYM/KEY</code> part, which defines which key the action is mapped to.
  
====BIND====
+
===<code>BIND</code>===
 
<code>BIND</code> begins a block of key bindings for a specified action in the Key Bindings menu.
 
<code>BIND</code> begins a block of key bindings for a specified action in the Key Bindings menu.
  
Line 108: Line 64:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! String
 
 
! Repeat Style
 
! Repeat Style
 +
! Behavior
 
|-
 
|-
 
| <code>REPEAT_NOT</code>
 
| <code>REPEAT_NOT</code>
| Don't repeat
+
| The action does not repeat at all; pressing the key performs the action exactly once, no matter how long it is held.
 
|-
 
|-
 
| <code>REPEAT_SLOW</code>
 
| <code>REPEAT_SLOW</code>
| Delayed repeat
+
| The action repeats after a delay of [[DF2014:Technical_tricks#Keyboard|<code>KEY_HOLD_MS</code>]] milliseconds.
 
|-
 
|-
 
| <code>REPEAT_FAST</code>
 
| <code>REPEAT_FAST</code>
| Immediate repeat
+
| The action repeats immediately.
 
|}
 
|}
 
It is not possible to specify key bindings with different repeat styles for the same action; if more than one <code>BIND</code> exists for the same action, the repeat style of the last <code>BIND</code> is used for all bound keys.
 
It is not possible to specify key bindings with different repeat styles for the same action; if more than one <code>BIND</code> exists for the same action, the repeat style of the last <code>BIND</code> is used for all bound keys.
  
Vanilla interface.txt already includes <code>BIND</code> entries for all valid actions. It is possible to remove all key bindings for a given action by removing all <code>SYM</code> and <code>KEY</code> entries after the action's <code>BIND</code>, and (optionally) removing the <code>BIND</code> itself. This, however, can result in frequent warnings output to the terminal if the game wants to display a key binding for the action (e.g. {{DFtext|;: Movies}} in the Dwarf Mode side bar; one can mitigate this by closing the side bar with {{k|Tab}}).
+
Vanilla interface.txt already includes <code>BIND</code> entires for all valid actions. It is possible to remove all key bindings for a given action by removing all <code>SYM</code> and <code>KEY</code> entries after the action's <code>BIND</code>, and (optionally) removing the <code>BIND</code> itself. This, however, can result in frequent warnings output to the terminal if the game wants to display a key binding for the action (e.g. {{DFtext|;: Movies}} in the Dwarf Mode side bar; one can mitigate this by closing the side bar with {{k|Tab}}).
  
====SYM====
+
===<code>SYM</code>===
 
<code>SYM</code> is used for keys listed as {{DFtext|By position}} in the Key Bindings menu.
 
<code>SYM</code> is used for keys listed as {{DFtext|By position}} in the Key Bindings menu.
  
Line 150: Line 106:
 
The key can be any letter or number, or can be listed by name. This is useful when typing the actual symbol would cause a syntax error (for example, <code>[SYM:0:]]</code> and <code>[SYM:0::]</code> cause errors instead of representing {{k|]}} and {{k|&#58;}}), or when the symbol isn't type-able (it's hard to insert a backspace character in a basic text editor without deleting something).
 
The key can be any letter or number, or can be listed by name. This is useful when typing the actual symbol would cause a syntax error (for example, <code>[SYM:0:]]</code> and <code>[SYM:0::]</code> cause errors instead of representing {{k|]}} and {{k|&#58;}}), or when the symbol isn't type-able (it's hard to insert a backspace character in a basic text editor without deleting something).
  
====KEY====
+
===<code>KEY</code>===
  
 
<code>KEY</code> is a simpler version of <code>SYM</code>, only allowing plain keys (no modifiers). These are listed as {{DFtext|By letter}} in the Key Bindings menu.
 
<code>KEY</code> is a simpler version of <code>SYM</code>, only allowing plain keys (no modifiers). These are listed as {{DFtext|By letter}} in the Key Bindings menu.
Line 160: Line 116:
 
Unlike the above, the key must be given as an actual symbol. Entries such as <code>[KEY:]]</code> and <code>[KEY::]</code> work as one might expect, i.e., representing {{k|]}} and {{k|&#58;}}, respectively.
 
Unlike the above, the key must be given as an actual symbol. Entries such as <code>[KEY:]]</code> and <code>[KEY::]</code> work as one might expect, i.e., representing {{k|]}} and {{k|&#58;}}, respectively.
  
====Differences between <code>KEY</code> and <code>SYM</code>====
+
===Differences between <code>KEY</code> and <code>SYM</code>===
  
 
<code>KEY</code> '''does''' allow special characters '''if''' they are able to be typed. For example, <code>[KEY:%]</code> is equivalent to <code>[SYM:1:5]</code>. Note that <code>SYM</code> requires the key on the keyboard, while <code>KEY</code> requires the letter generated.
 
<code>KEY</code> '''does''' allow special characters '''if''' they are able to be typed. For example, <code>[KEY:%]</code> is equivalent to <code>[SYM:1:5]</code>. Note that <code>SYM</code> requires the key on the keyboard, while <code>KEY</code> requires the letter generated.

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Templates used on this page:

This page is a member of 1 hidden category: