Godot-proposals: Add "+/-" shortkeys to edit variables in inspector

Created on 5 Sep 2019  路  10Comments  路  Source: godotengine/godot-proposals

Describe enhancement of the existing feature:
To change integer value in the Inspector you can:

  • Click into the field, drag mouse up/down or left/right to +1/-1. (Mouse)
  • Use buttons up/down near the field. (Mouse)
  • Click into the field, set new value. (Keyboard)

It would be great, if you can increment/decrement integer values using keyboard, like:

  • Click into the field, use up/down keys to +1/-1 (Keyboard)

Now if you use up/down keys when you are editing the field it will set cursor position to begin/end of value (Which is not that useful in my opinion.)
L5zTaFR

As title says, this issue is about "+/-" short-keys, but in discussion below @girng suggested a better way.
I can't change the issue title.

editor

Most helpful comment

i think clicking inside the int field, then using arrow keys is ideal, if you want keyboard precision.

+/- would imo hurt the user experience, cause some keyboards don't have the numpad, and if they don't, the user has to hold shift.

All 10 comments

but it require to click on them using mouse

Sometimes I found it difficult to hit the right arrow (no pun intended!).

It will be easier to use +/- buttons on keyboard.

How would the behaviour work if the user selects inside of the field (like text)? Currently, it literally types a '+' or '-' which a lot of users need to input math (Like '200+10' which is later evaluated)

It will be easier to use +/- buttons on keyboard.

How would the behaviour work if the user selects inside of the field (like text)? Currently, it literally types a '+' or '-' which a lot of users need to input math (Like '200+10' which is later evaluated)

Perhaps using the up and down keys would work better then?

How would the behaviour work if the user selects inside of the field (like text)?

In a normal way I suppose, this feature shouldn't work while editing value and should work only with integers. If you press increment/decrement buttons it will select field, but not edit it.

image
As @JustYourAverageJosh mentioned, it will be logically use _Up/Down_ buttons on keyboard, but they are using for navigation in the inspector. (_Ctrl + Up/Down_, also needed for something else).

_Shift + Up/Down_ seems free (it used to change nodes position in scene editing, but it isn't work while using an inspector).

you can:

  • click into the field, and drag mouse left or right (this would work nice with your circle).
  • use the arrow buttons
  • or just simply edit the field to adjust your value.

i think the functionality to modify an int value is sufficient

use the arrow buttons

Usually when you need the arrow buttons, you use them at least 3-5 times. It will improve user experience, if simple action like this could be accomplished without using mouse.

There are a lot of mini improvements in editing experience, like delete button in the Inspector affect selected node, not selected value-field, but for them issues already created.

click into the field, and drag mouse left or right (this would work nice with your circle)

Imagine I have to seed a value from inspector while the game is running.

It's simply not as easy to control the exact number of increments/decrements with mouse movement, you could accidentally go through in-between values which would lead to unnecessary generation steps which could take a while (this could be optimized but that not the point here).

And there's not enough space on the mouse pad to keep changing the value infinitely. 馃檪

i think clicking inside the int field, then using arrow keys is ideal, if you want keyboard precision.

+/- would imo hurt the user experience, cause some keyboards don't have the numpad, and if they don't, the user has to hold shift.

Clicking inside the field and using the arrow keys is totally what I do every time (even if it doesn't work) because I'm used to doing exactly that within the web inspector while working on websites. You select a CSS value, press the up or down keys and modify the value by 1 while your eyes are looking at the element on the screen.
Also pressing shift + up or shift + down adds or subtracts 10 units.

I would love to see this implemented so my muscle memory works when I use Godot. I'll try to get it done 馃挭

Quoting my response in discussion from PR to issue for potential discussing:

An issue occurs with using devtools style is that in GDScript, you can export a variable with a given step. I.E.

@export_range(0, 100, 0.5)
var my_exported_range = 50.0

So the question occurs: if pressing up does 0.5, if the user holds down CTRL/CMD, SHIFT or ALT and presses up, how does the number react? 50.0, 5.0, 0.5, 0.05?

The default step for floating point numbers is 0.001, furthermore. Unless we force the values to 100, 10, 1, 0.1, that makes even ctrl/cmd have only a small effect.

EDIT: One suggestion is to make modifier-less up and down use step, and the rest go with their devtool style of 100, 10 and 0.1.

Was this page helpful?
0 / 5 - 0 ratings