vi-style key bindings

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Post Reply
Message
Author
Old Tomnoddy
Wayist
Posts: 19
Joined: Tue May 25, 2010 11:49 pm

vi-style key bindings

#1 Post by Old Tomnoddy »

No roguelike's healthy without 'em. (Note that the following will remove the mappings for the arrow keys altogether and remap “look around” to the key “x”. Please post if you think I missed some other conflicting binding.)

Code: Select all

diff -ur ../t-engine4-src-1.0.0beta2/game/data/keybinds/actions.lua ./game/data/keybinds/actions.lua
--- ../t-engine4-src-1.0.0beta2/game/data/keybinds/actions.lua	2010-05-20 20:06:02.000000000 +0200
+++ ./game/data/keybinds/actions.lua	2010-05-27 08:38:36.000000000 +0200
@@ -73,7 +73,7 @@
 }
 
 defineAction{
-	default = { "uni:l" },
+	default = { "uni:x" },
 	type = "LOOK_AROUND",
 	group = "actions",
 	name = "Look around",
diff -ur ../t-engine4-src-1.0.0beta2/game/data/keybinds/move.lua ./game/data/keybinds/move.lua
--- ../t-engine4-src-1.0.0beta2/game/data/keybinds/move.lua	2010-05-20 20:06:02.000000000 +0200
+++ ./game/data/keybinds/move.lua	2010-05-27 08:35:24.000000000 +0200
@@ -19,56 +19,56 @@
 
 -- Character movements
 defineAction{
-	default = { "sym:276:false:false:false:false", "sym:260:false:false:false:false" },
+	default = { "uni:h" },
 	type = "MOVE_LEFT",
 	group = "movement",
 	name = "Move left",
 }
 defineAction{
-	default = { "sym:275:false:false:false:false", "sym:262:false:false:false:false" },
+	default = { "uni:l" },
 	type = "MOVE_RIGHT",
 	group = "movement",
 	name = "Move right",
 }
 defineAction{
-	default = { "sym:273:false:false:false:false", "sym:264:false:false:false:false" },
+	default = { "uni:k" },
 	type = "MOVE_UP",
 	group = "movement",
 	name = "Move up",
 }
 defineAction{
-	default = { "sym:274:false:false:false:false", "sym:258:false:false:false:false" },
+	default = { "uni:j" },
 	type = "MOVE_DOWN",
 	group = "movement",
 	name = "Move down",
 }
 defineAction{
-	default = { "sym:263:false:false:false:false" },
+	default = { "uni:y" },
 	type = "MOVE_LEFT_UP",
 	group = "movement",
 	name = "Move diagonally left and up",
 }
 defineAction{
-	default = { "sym:265:false:false:false:false" },
+	default = { "uni:u" },
 	type = "MOVE_RIGHT_UP",
 	group = "movement",
 	name = "Move diagonally right and up",
 }
 defineAction{
-	default = { "sym:257:false:false:false:false" },
+	default = { "uni:b" },
 	type = "MOVE_LEFT_DOWN",
 	group = "movement",
 	name = "Move diagonally left and down",
 }
 defineAction{
-	default = { "sym:259:false:false:false:false" },
+	default = { "uni:n" },
 	type = "MOVE_RIGHT_DOWN",
 	group = "movement",
 	name = "Move diagonally right and down",
 }
 
 defineAction{
-	default = { "sym:261:false:false:false:false" },
+	default = { "uni:." },
 	type = "MOVE_STAY",
 	group = "movement",
 	name = "Stay for a turn",
@@ -76,49 +76,49 @@
 
 -- Running
 defineAction{
-	default = { "sym:276:false:true:false:false", "sym:260:false:true:false:false" },
+	default = { "uni:H" },
 	type = "RUN_LEFT",
 	group = "movement",
 	name = "Run left",
 }
 defineAction{
-	default = { "sym:275:false:true:false:false", "sym:262:false:true:false:false" },
+	default = { "uni:L" },
 	type = "RUN_RIGHT",
 	group = "movement",
 	name = "Run right",
 }
 defineAction{
-	default = { "sym:273:false:true:false:false", "sym:264:false:true:false:false" },
+	default = { "uni:K" },
 	type = "RUN_UP",
 	group = "movement",
 	name = "Run up",
 }
 defineAction{
-	default = { "sym:274:false:true:false:false", "sym:258:false:true:false:false" },
+	default = { "uni:J" },
 	type = "RUN_DOWN",
 	group = "movement",
 	name = "Run down",
 }
 defineAction{
-	default = { "sym:263:false:true:false:false" },
+	default = { "uni:Y" },
 	type = "RUN_LEFT_UP",
 	group = "movement",
 	name = "Run diagonally left and up",
 }
 defineAction{
-	default = { "sym:265:false:true:false:false" },
+	default = { "uni:U" },
 	type = "RUN_RIGHT_UP",
 	group = "movement",
 	name = "Run diagonally right and up",
 }
 defineAction{
-	default = { "sym:257:false:true:false:false" },
+	default = { "uni:B" },
 	type = "RUN_LEFT_DOWN",
 	group = "movement",
 	name = "Run diagonally left and down",
 }
 defineAction{
-	default = { "sym:259:false:true:false:false" },
+	default = { "uni:N" },
 	type = "RUN_RIGHT_DOWN",
 	group = "movement",
 	name = "Run diagonally right and down",


darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: vi-style key bindings

#2 Post by darkgod »

But ....
Why don't you just bind the keys to whatever you wish in the interface whose whole purpose is to do just that ? ;)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Old Tomnoddy
Wayist
Posts: 19
Joined: Tue May 25, 2010 11:49 pm

Re: vi-style key bindings

#3 Post by Old Tomnoddy »

D'oh! Thanks for the pointer: I actually tried this, but as I don't use the arrow keys in GUI at all and I am running a mouse-reduced wm I didn't figure out how to scroll down in the bindings menu -- scrolling down using the mouse wheel didn't work so I concluded that there is no such option … Now that I have decent bindings I finally got where I wanted.

Would you mind implementing a scroll bar or, better, an indicator like “--more--” at the bottom of the key bindings section (and in general wherever there is more to opt)? As you can see, for some very ignorant people like me this isn't immediately obvious.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: vi-style key bindings

#4 Post by darkgod »

I will )
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Antagonist
Higher
Posts: 71
Joined: Sun May 23, 2010 9:55 am

Re: vi-style key bindings

#5 Post by Antagonist »

How about a keymap defaults option? standard style keymaps and vi-style like Tomnoddy has.

Though they can come to the forums and find it or manually set every key themselves, or write a file like he has, I think its a common enough thing that warrants such an option.

I'm sure he's not the only one, though personally I would never try it.

Heh, just need to track down all the string literals too, like the "Press 'G' for level up screen." thing.

Post Reply