Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

I recently downloaded NetHack, and have begun to play on my laptop. However, I find the directional key bindings rather cumbersome. I do not have a Number Pad, and would rather not use the NumLock function on my laptop's keyboard. So, I'm currently left to deal with the default non-numerical bindings for movement. These are very counter-intuitive.

The help file displays them as this:

y k u
 \|/   
h-.-l
 /|\
b j n

When, in reality, they're laid out more like this:

 YU
 HJKL.
BN

Is there any way to change this key binding to be less confusing - perhaps even using the actual directional keypad?

share|improve this question
9  
The good news is that after all that nethack, you'll be a whiz at VI! –  Robb Jan 14 '11 at 5:30
    
You might think so but try playing ADOM after playing nethack or vica-versa! –  SLC Apr 7 at 10:48
add comment

4 Answers

As far as I know, there's no way to remap the keys outside of a recompiling from source, or a crazy hack like using AutoHotKey to map entirely different keys on the keyboard to hjkl/yubn. Obviously that has side-effects though.

So you have a couple of options:

  1. You may not have an actual numpad, but most laptops have a mode that can "convert" part of the keyboard into a numpad, by holding down the "Fn" key, or using a "Fn Lock" key to toggle it on/off.
  2. Get used to hjkl/yubn, and be glad that if you ever decide to learn how to use vim in the future, you'll already have moving around with hjkl solidly ingrained into your muscle memory.
share|improve this answer
    
I found that vikeys was confusing for a few hours, but after that it feels just as natural as the keypad, and is a lot less painful on the hands. –  Wooble Jan 14 '11 at 3:51
    
Really? It's not just NetHack? What sadistic bofh came up with this? –  Iszi Jan 14 '11 at 20:45
    
@lszi: As I understand it, the idea is that it doesn't require you to move your fingers away from the home row at all. It doesn't take long to get used to, I'm a vim user and don't even have to think about it any more at all. –  Chad Birch Jan 16 '11 at 17:45
    
Honestly, in Vi, you don't really use directional keys either. You stick to the keys that bring you exactly where you want to be. @Iszi Terminals that did not have arrow keys needed something. Some chose WASD, some chose HJKL. –  user56 Jan 19 '11 at 14:00
2  
@Iszi: A long, long time ago, there actually were arrows on the hjkl keys of the keyboard, so mapping them to left, up, down, right was natural. –  Trevoke Jan 30 '11 at 2:08
show 2 more comments

You don't say which version of Nethack you're using, but I think most of the GUI clients should support directional keys. The Windows port definitely does.

share|improve this answer
    
Could you provide a link to the port that you're talking about? I don't think it's the same one I'm using. –  Iszi Feb 13 '11 at 4:29
    
@Iszi I'm talking about nethackw.exe from the official Windows port. –  user56 Feb 13 '11 at 9:21
    
I still am not finding the option. Could you post instructions to your answer? Thanks. –  Iszi Feb 14 '11 at 3:40
    
@Iszi There aren't really instructions, you just launch the game, press up to go up, down to go down, left to go left and right to go right. –  user56 Feb 14 '11 at 5:52
    
I have to go with Arda on this one....I use nethackw.exe all the time now and use the direction keys just fine. –  espais Mar 10 '11 at 18:13
add comment

If you edit the default.nh file in the game's root directory, you can set 'number_pad:1' or 2 to use the numpad for movement. See the guidebook for more details. Doing this also frees up letter keys for other commands, and won't cause confusions later if you map inventory items to consistent letters.

Having your movement keys in one place controlling nothing but movement is a much more sensible control layout than vim uses; I don't know why everyone has to give you a hard time instead of giving the simple answer.

share|improve this answer
    
Reading the question notes that the original poster does not have a numpad. Also, IIRC, the Windows port does default to the numpad. –  Doktoro Reichard Apr 3 at 0:23
    
@DoktoroReichard this could still be helpful for someone else –  shanodin Apr 3 at 4:47
add comment

Somewhat inspired by Cameron's answer, there may be another option to actually change the keyboard layout. Note however that this should only work on the Windows tty version of the game. To correct some keyboard localization issues, the OPTIONS=subkeyvalue:x/y allows for one given character to be replaced by another, as stated in the 3.4.3 Guidebook

The fact is that this seems not to work, as I have tested this myself to no avail. All research I found on the net seems to indicate that either this only works for the Finnish problem or that no one was able to make it work.

Thus, Nethack offers no solution to this problem. Another possible way to circumvent this is by using programs such as SharpKeys (which allows for easy registry-based mapping) or AutoHotKey, with the caveats I mentioned earlier about losing functionality. To sum it up, Nethack is so filled with commands that trying to remap other keys will remove some functionality from the game.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.