- Code: Select all
--- game.cpp 2015-09-12 02:50:54.205681153 -0500
+++ game.cpp.new 2015-09-12 02:46:24.224342387 -0500
@@ -1236,6 +1236,9 @@
KEYMAP_ID_SPECIAL1,
KEYMAP_ID_SNEAK,
+ //djr
+ KEYMAP_ID_AUTORUN,
+
// Other
KEYMAP_ID_DROP,
KEYMAP_ID_INVENTORY,
@@ -1287,6 +1290,9 @@
key[KEYMAP_ID_SPECIAL1] = getKeySetting("keymap_special1");
key[KEYMAP_ID_SNEAK] = getKeySetting("keymap_sneak");
+ // djr
+ key[KEYMAP_ID_AUTORUN] = getKeySetting("keymap_autorun");
+
key[KEYMAP_ID_DROP] = getKeySetting("keymap_drop");
key[KEYMAP_ID_INVENTORY] = getKeySetting("keymap_inventory");
key[KEYMAP_ID_CHAT] = getKeySetting("keymap_chat");
@@ -2616,6 +2622,10 @@
if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_DROP])) {
dropSelectedItem();
+ // djr
+ } else if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_AUTORUN])) {
+ bool autorun_setting = g_settings->getBool("continuous_forward");
+ g_settings->setBool("continuous_forward", !autorun_setting);
} else if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_INVENTORY])) {
openInventory();
} else if (input->wasKeyDown(EscapeKey) || input->wasKeyDown(CancelKey)) {
I also added a change to disable the scroll wheel, because I keep activating my trackpad's scroll by mistake.
- Code: Select all
@@ -2704,7 +2714,8 @@
*/
*new_playeritem = client->getPlayerItem();
- s32 wheel = input->getMouseWheel();
+ //s32 wheel = input->getMouseWheel();
+ s32 wheel = 0;
u16 max_item = MYMIN(PLAYER_INVENTORY_SIZE - 1,
player->hud_hotbar_itemcount - 1);
You'll also want to add a key setting to your minetest.conf file, replacing the "P" with your key choice.
- Code: Select all
keymap_autorun = KEY_KEY_P
This seems to work fine on my system, and I can't imagine any reason why it wouldn't work on windoze, but it's obviously not useful for android. However, I may discover that it screws everything up tomorrow, so use at your own risk.
I'm sure somebody has done this before, but I've searched for days and couldn't find it.