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.

v0.31 Talk:Key bindings

From Dwarf Fortress Wiki
Jump to navigation Jump to search

OSX[edit]

Anybody using DF on a small mac keyboard? How can you remap the delete key?--Kwieland 00:07, 24 July 2010 (UTC)

From the top-level game interface, hit the Escape key to get to the game options. Go to "Key Bindings", then "Text Entry". The first option is "String: Backspace". Choose "Add Binding" (right arrow) and hit the key you want to use for backspace. (I have a full keyboard so I use the "Delete |X>" key, but I assume you will have to use something like a backslash or maybe a control key combination, if that works.) Then hit Escape and choose "Save and Exit", unless you want to just try out the key for this session. The "Delete" key does work to remove bindings, so feel free to experiment until you find something you like.--Scrotch 03:08, 20 November 2010 (UTC)
Thanks for the advice! I tried this but found that String: Backspace was already bound to the key I want to use ("delete" on my Apple keyboard), but it doesn't function that way. I'll bind another key as a workaround... -- Maunder 22:37, 20 November 2010 (UTC)


interface.txt file format[edit]

Here's a bit on the file format for those who edit the interface.txt file by hand.

The file consists of multiple action-keybinding blocks, for example:

[BIND:SELECT:REPEAT_NOT]    <-- action
[SYM:0:Enter]               <-- keybinding
[SYM:0:Numpad Enter]        <-- another keybinding for that action

The action statements has the following two formats:

[BIND:<action>:<repeat>]
action: the code of the action, these should be easy to understand
repeat: determines how often the action is repeated when the key is held down valid values are REPEAT_NOT, REPEAT_SLOW, REPEAT_FAST.

The keybinding statements have the following format:

  • [KEY:<key>]
key: the key here is interpreted literally, producing this character will result in the action. For example; an action bind to [KEY:0] is triggered by both, the 0-key in the typewriter block as well as the 0-key on the numpad.
  • [SYM:<modifier>:<key>]
modifier: an integer that represents the combination of alt, ctrl and shift. (note: AltGr is interpreted as ctrl+alt)
value modifier
0 no modifier
1 shift
2 ctrl
4 alt
Modifier values add up, so the value for shift+ctrl is 1+2=3.
key: the code for the key. Most keys are spelled out (Enter, Page Down), but not all (ESC). All numpad keys are prefixed by Numpad (Numpad Enter).

--82.169.8.34 23:18, 2 January 2011 (UTC)