Binding keys

From NetHackWiki
Jump to: navigation, search

In your options file, it is possible to change the default key bindings of some special commands, menu accelerator keys, and extended commands. Keybinding lines begin with BIND= or BINDINGS=, followed by a comma-separated list of the format key:command. There can be many BIND entries.

The key for binding can be a single character (x), a control key (^x), a meta key (M-x), or a three-digit decimal ASCII code.

Examples from the Guidebook:

BIND=^X:getpos.autodescribe
BIND={:menu_first_page
BIND=v:loot

You can bind multiple keys to the same extended command (loot, annotate, etc). To unbind a key, bind the key to nothing. You can also bind the <esc>, <enter>, and <space> keys.

Extended commands

Main article: Extended command

Extended commands can be bound to keys. See the extended command article for a complete list.

Special command keys

Below are the special commands you can rebind, as found in the Guidebook. Some of them can be bound to the same keys as others with no problems, while others are in the same "context" and only one entry would behave as intended. Unlike extended commands, special commands can only be bound to a single key.

Special command Default Description
count n Prefix key to start a count, to repeat a command this many times.
doinv 0 Show inventory. With number_pad only.
fight F Prefix key to force fight a direction.
fight.numpad - Prefix key to force fight a direction. With number_pad only.
getdir.help ? When asked for a direction, the key to show the help.
getdir.self . When asked for a direction, the key to target yourself.
getdir.self2 s When asked for a direction, the key to target yourself.
getpos.autodescribe # When asked for a location, the key to toggle autodescribe.
getpos.all.next a When asked for a location, the key to go to the next closest interesting thing.
getpos.all.prev A When asked for a location, the key to go to the previous closest interesting thing.
getpos.door.next d When asked for a location, the key to go to the next closest door.
getpos.door.prev D When asked for a location, the key to go to the previous closest door.
getpos.help ? When asked for a location, the key to show help.
getpos.mon.next m When asked for a location, the key to go to the next closest monster.
getpos.mon.prev M When asked for a location, the key to go to the previous closest monster.
getpos.obj.next o When asked for a location, the key to go to the next closest object.
getpos.obj.prev O When asked for a location, the key to go to the previous closest object.
getpos.menu ! When asked for a location, and using one of the next or previous keys to cycle through targets, toggle showing a menu instead.
getpos.moveskip * When asked for a location, and using the shifted movement keys or meta-digit keys to fast-move around, move by skipping the same glyphs instead of by 8 units.
getpos.filter " When asked for a location, change the filtering mode when using one of the next or previous keys to cycle through targets. Toggles between no filtering, in view only, and in the same area only.
getpos.pick . When asked for a location, the key to choose the location, and possibly ask for more info.
getpos.pick.once , When asked for a location, the key to choose the location, and skip asking for more info.
getpos.pick.quick ; When asked for a location, the key to choose the location, skip asking for more info, and exit the location asking loop.
getpos.pick.verbose : When asked for a location, the key to choose the location, and show more info without asking.
getpos.self @ When asked for a location, the key to go to your location.
getpos.unexplored.next x When asked for a location, the key to go to the next closest unexplored location.
getpos.unexplored.prev X When asked for a location, the key to go to the previous closest unexplored location.
getpos.valid $ When asked for a location, the key to show valid target locations.
getpos.valid.next z When asked for a location, the key to go to next closest valid location.
getpos.valid.prev Z When asked for a location, the key to go to previous closest valid location.
nopickup m Prefix key to move without picking up items.
redraw ^R Key to redraw the screen.
redraw.numpad ^L Key to redraw the screen. With number_pad only.
repeat ^A Key to repeat previous command.
reqmenu m Prefix key to request menu from some commands.
run G Prefix key to run toward a direction
run.nopickup M Prefix key to run toward a direction without picking up items on the way.
run.numpad 5 Prefix key to run toward a direction. With number_pad only.
rush g Prefix key to rush toward a direction.