Controlling

Controlling

266M Downloads

Searching for a key could be better

hvdklauw opened this issue ยท 5 comments

commented

It has been a gripe of mine for a while, but often the B key is used for multiple bindings and I have to fix that, but searching forkey:B or key:"B" gives everything containing B, like mouse buttons and Not Bound especially the last one is really annoying in big modpacks.

I think two changes would fix this:

  1. key searches should automatically exclude all the unbound things
  2. using key:"B" should be exact matching only, so no matching backspace, mouse buttons, tab

For the last one I'm on the fence for including Ctrl+B, Shift+B etc, I think it's ok to include those, but maybe you want true exact matching so if you want to search for that it should be key:"CTRL+B"

commented

Ok, I can see that.

Maybe then make the Show Unbound button actually include/exclude/exclusive showing unbound actions... it's mostly the Unbound that makes the list very long.

commented

Unfortunately I feel that no matter how the system is implemented, someone is always going to have an issue with it, even in your own issue you are conflicted if key:"B" should return modifier keybinds as well.

I personally like how it is now, if I want to find everything bound to a shift key, I don't want to have to type key:"left shift" and then another key:"right shift" search. It also lets me search for all keys that have a modifier (I should probably turn that into a modifier:shift search filter at some point) showing more keys is better then showing fewer keys imo.

key searches should automatically exclude all the unbound things

I'm inclined to agree with this, but I would like to sit and think on it a bit more, I can't really see a usecase to show unbound keys right now, but if I am removing information from a search, I want to make sure it shouldn't affect anyone.

using key:"B" should be exact matching only, so no matching backspace, mouse buttons, tab

quoted searches (key:"a" | key:'a' | key:`a`) are a thing to deal with multi-word values, such as key:'Left Button', key:'Right Shift' and category:"Creative Mode", if I used quotes to match exact, you would not be able to search for things, for example searching for name:"hotbar slot" gives you all the hotbar slots, with your suggested change, it would return nothing.

It is possible in the future I can add something along the lines of:

// Current default
key:B filter:contains
// match the key exactly
key:B filter:exact
// match the key if it starts with the letter
key:B filter:starts_with
// match the key if it ends with the letter
key:B filter:ends_with
// etc

// or potentially this.
key:starts_with:B
key:equals:B

which should solve your issue, however this would require breaking API changes and a redesign of a the filtering system, which I do not have the time to do right now, so I'm going to leave this issue open for now.