Page 1 of 1
[v1.0.1-1.0.5] Inventory Keys
Posted: Tue Apr 30, 2013 1:26 am
by Zizzo
Prompted by
a suggestion in another addon thread, I went digging in the inventory UI code and discovered that the requested feature, selecting inventory items by list letter, was already implemented in the engine --
if the right part of the dialog has focus, which it doesn't by default. Now, you could focus the right part by mouse, but once you've done that you might as well select the item by mouse too. Well, as long as I was there fixing that, I figured I'd add some other tweaks I'd been missing myself, leading to my new
Inventory Keys addon. Here's what this adds:
- As described above, by putting the focus in the right place when we create the dialog, we effectively enable the engine functionality of selecting an inventory item by typing its list letter. If you move the focus somewhere else with the mouse, you're on your own.

- I don't know when this was lost, but I used to love the ability to move between the equipment and inventory sections of the inventory dialog with the left and right arrow keys, because it let me easily select an equipment item to activate without using the mouse. That's back now.
- Similarly, we restore the lost "wrap-around" functionality of inventory lists, so that moving down from the last item on the list will wrap around to the top and vice versa.
Note that this all applies both to the main inventory dialog and the various inventory-related dialogs used by the 'd'rop command and various item-using talents.
As always, I'm putting this out for beta testing and suggestions before possible merging into ZOmnibus.
[edit 2013-10-31 10:25pm]
Technical info:
Code: Select all
Superload:
mod.dialogs.ShowInventory:
init() [to allow wraparound and put focus on the list]
mod.dialogs.ShowEquipInven:
init() [as above]
mod.dialogs.UseItemDialog:
init() [to catch mnemonic keys and invoke corresponding actions]
on_register() [to make the preceding actually work]
generateList() [to add action mnemonics]
Re: [v1.0.1] Inventory Keys
Posted: Fri May 03, 2013 6:24 pm
by Hunter
Seems to be working perfectly so far. Thanks.

Re: [v1.0.1] Inventory Keys
Posted: Sat May 04, 2013 10:37 pm
by Zizzo
Did I say no complaints with this addon? That was tempting fate... Just tripped over a stupid bug in up/down arrow key handling in the 'd'rop dialog --- same bug I'd already fixed in the main inventory dialog, but somehow forgot to check for here.

Just pushed out v1a with the fix. We Apologize for the Inconvenience.(TM)
Re: [v1.0.1] Inventory Keys
Posted: Fri May 10, 2013 3:26 am
by Zizzo
And migrating to v1.0.3.
Re: [v1.0.1] Inventory Keys
Posted: Wed May 22, 2013 1:38 am
by Zizzo
And migrating again to v1.0.4.
Re: [v1.0.1-1.0.4] Inventory Keys
Posted: Mon Sep 16, 2013 1:55 am
by Jeoshua
I've been using this, along with the zOmnibus, to get a bit more mileage out of my keyboard with this game. It works great, but there is just one gripe:
You hit "i" to open inventory. Great.
You then hit "a-z" to select something.
But then at that point you have to select the action with your arrow keys.
What about modifying that dialogue box so that you can type different characters, like:
"w" to wield.
"u" to use.
"d" to drop.
"T" (that's Shift-t) to Transmogrify.
etc.
Re: [v1.0.1-1.0.4] Inventory Keys
Posted: Fri Nov 01, 2013 2:19 am
by Zizzo
[We Apologize for the Delay;(TM) buying and moving into a condo is a time-comsuming and stressful process, as I'm sure you can imagine...]
Jeoshua wrote:What about modifying that dialogue box so that you can type different characters, like:
"w" to wield.
"u" to use.
"d" to drop.
"T" (that's Shift-t) to Transmogrify.
etc.
After an annoying amount of effort getting the use-item dialog to actually respond usefully to keystrokes, I've bashed together an implementation of this. The mnemonic keys defined for the game's built-in item actions are:
Code: Select all
i Identify
m Move to normal inventory
u Use
w Wield/Wear
t Take off
d Drop
p Transfer to party
c Link item in chat
T Transmogrify now
Addons that define new item actions via the 'UseItemMenu:generate' hook can also define the mnemonic to be used for the action. In the { name="Do a thing", action="do_thing" } table that you add to the data.menu list, just add a mnemonic="D" field. (Mnemonics are first come first served for now, so if two actions specify the same character for their mnemonic, whichever gets added first will get it.) For actions that don't define a mnemonic, the addon will try to fake up one using the first character of the action name, if that character hasn't already been used.
And that's pushed out as v1d. Let me know if anything breaks...

And pursuant to
DarkGod's subtle hint,

I've gone back and added technical info to
the original release post.
Re: [v1.0.1-1.0.4] Inventory Keys
Posted: Wed Nov 13, 2013 5:58 am
by Zizzo
Migrating to v1.0.5. The new built-in item actions get their own mnemonics:
Code: Select all
g Tag
G Untag
X Lua inspect (via cheat mode)
[Note that if you're also using
Use Item Shortcuts (or ZOmnibus), the "Grasp telekinetically" action, whose mnemonic used to be 'g', is changed to 'K' to avoid collision. We Apologize for the Inconvenience.(TM)]
Re: [v1.0.1-1.0.5] Inventory Keys
Posted: Sun Jun 22, 2014 1:03 am
by Zizzo
Pushing out v1g, with a
bugfix that was clobbering Alchemists' Interact with Golem talent.
Re: [v1.0.1-1.0.5] Inventory Keys
Posted: Fri Oct 24, 2014 1:06 am
by Zizzo
New small release v1h, with new mnemonics 'A' and 'D' for the new in-game item actions Attach to item and Detach from item. Should be interesting finding out what those are for...

Re: [v1.0.1-1.0.5] Inventory Keys
Posted: Fri May 29, 2015 2:42 am
by Zizzo
Pushing out
bugfix release v1h.1. I think I've
finally got the Interact with Golem bug sorted out this time...

Re: [v1.0.1-1.0.5] Inventory Keys
Posted: Fri Mar 10, 2017 12:12 am
by Zizzo
Release v1i has one small change for v1.5: since the "Detach tinker" item command is now officially defined by the module instead of added by
Tinker Tinkering, we have to patch in our mnemonic key for the command instead of defining it when we add the command. As before, we assign it the 'D' key; that actually collides with the "Detach from item" command, but that would only be a problem for a tinker with its own tinker attached, which I don't think is supported.

Re: [v1.0.1-1.0.5] Inventory Keys
Posted: Sat Nov 09, 2019 1:39 am
by Zizzo
v1i.1 fixes a six-year-old bug reported on Steam: a tiny typo that broke handling of entries in the use-item dialog that ended up without a mnemonic key assigned to them. Amazing that that never came up before… We Apologize for the Inconvenience.™
Re: [v1.0.1-1.0.5] Inventory Keys
Posted: Sun Feb 21, 2021 1:43 am
by Zizzo
Inspired by a
recent request, I'm releasing v2 with a new interface for customizing the shortcut keys that we add to the use-item dialog. The new game option "[ZOmnibus] | Use-item dialog shortcuts" brings up the new Use-Item Dialog Shortcuts dialog, whence you can set or unset your own keys for various actions on the use-item dialog. [
Disclaimer: This interface is kind of experimental, and I'm not really sure what kinds of keys will actually work as shortcuts in this contexts, so proceed with caution.]