Key bindings?

https://attnam.com/topics/Key-bindings

The Cathedral of Attnam > General IVAN Discussion

#1 May 7, 2014, 4:23 pm Hide

SenoraRaton

How do I modify the key bindings in IVAN? I'm on a laptop and don't have a number pad, and would love to use NetHack keys... But I can't find a config file, or any options to change it.
#2 May 7, 2014, 5:05 pm Hide

Pent

The ivan.cfg file (also accessible from option 3 on the main menu or the '\' key in-game) has an "Alternate Direction Keys" option, that binds the movement keys to the 8 keys surrounding the letter 'i' (7,8,9,u,o,j,k,l). It will rebind any command that uses one of those keys appropriately.

Alternatively, you could directly remap the movement keys in the game.cpp source file, but you'd need to recompile the game afterwards, which IMO is more of a hassle than just getting used to the preset keys.
#3 May 7, 2014, 6:21 pm Hide

SenoraRaton

That is rather unfortunate. There is no active codebase for IVAN is there? I suppose if I'm going to go through that kind of trouble I could just put in a keybinding option...
#4 May 7, 2014, 7:01 pm Hide

4zb4

Actually, there is a little of that going on. Slowly.
#5 May 8, 2014, 12:07 pm Hide

fejoa

Does anyone have a spec for what the key bindings should be? Like a map from IVAN to NetHack?
#6 May 8, 2014, 2:07 pm Hide

red_kangaroo

I must say that I find the alternate key binding to be very comfortable. Especially in comparsion to e.g. 123456789 direction keys, as I also play on a laptop with no number pad.
#7 May 8, 2014, 2:23 pm Hide

Pent

red_kangaroo wrote
I must say that I find the alternate key binding to be very comfortable. Especially in comparsion to e.g. 123456789 direction keys, as I also play on a laptop with no number pad.

I'm quite fond of them as well. This way I don't have to move my hands to press any of the keys on the right side of the keyboard.

Warheck, I believe it's hjkl for horizontal/vertical movement, and yubn for diagonal movement. So for IVAN you'd want the following:

Game.cpp
cint game::MoveAbnormalCommandKey[] = { 'y','k','u','h','l','b','j','n','.' };
#8 May 8, 2014, 2:51 pm Hide

fejoa

Could probably add a NetHack option to ivanconfig. At the moment it's a true/false question which is susequently and succinctly handled by game::GetMoveCommandKey() in game.cpp

We could get the user to scroll through a list of pre-cooked key bindings (NetHack, alternative...).
The other way would be to make it so the player can change their preferences for what keys they want to use. Offers a lot more flexibility, but a good way to break the game unless a function is created that checks the validity of the key binding options at the time of selection.
#9 May 9, 2014, 8:13 pm Hide

Pent

Warheck wrote
We could get the user to scroll through a list of pre-cooked key bindings (NetHack, alternative...).

I added a NetHack keymap that works this way (you can toggle between Normal, Alternative, and NetHack). I considered trying to port over the custom binding options from k8IVAN, but that could get messy, and honestly, who wants to remap that many commands? The movement controls seem to be the only things people have preferences for anyways (I've never seen anyone say "I wish the vomit key was 'm' instead of 'V'").
#10 May 10, 2014, 3:25 am Hide

red_kangaroo

Pent wrote
(I've never seen anyone say "I wish the vomit key was 'm' instead of 'V'").

I wish (D)rink was (q)uaff instead. (Seriously, I have dropped healing liquid several times when it could have killed me.)
#11 May 10, 2014, 8:37 am Hide

Pent

red_kangaroo wrote
I wish (D)rink was (q)uaff instead. (Seriously, I have dropped healing liquid several times when it could have killed me.)

But if you used 'q' to drink then it would be even more disastrous when you accidentally hit capslock/shift.