Shift/Alt/ctrl key support for Menu Sliders/numbers

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Shift/Alt/ctrl key support for Menu Sliders/numbers

Post by Major Cooke »

Some mods like my own have large number scales in their menus. It'd be nice if there could be an implementation within GZDoom's base itself that everyone can take advantage of.

I.e. say a slider has 100 units, and ticks by 1 when moving along with the keyboard. Could we add additional parameters to define when holding the shift/alt/ctrl keys, so I don't have to create duplicates that have bigger scaling units?

This would allow me to change this:

Code: Select all

	Slider "$MCM_HEALTHMUL1_TEXT",		MCC_HealthMul,			0.5, 100.0, 0.1
	Slider "$MCM_HEALTHMUL2_TEXT",		MCC_HealthMul,			1.0, 100.0, 1.0
Into this:

Code: Select all

Slider "$MCM_HEALTHMUL_TEXT",		MCC_HealthMul,			0.5, 100.0, 0.1, 1.0, 0.05, 10.0
In order, left to right:
  • Shift value amount. Programs like Blender tend to use this to amplify the change.
  • Alt value amount. Usually used to reduce the amount changed for precision.
  • Ctrl/cmd value amount. Special case where it's percentage based instead.
So in my example above, when holding one of the keys and changing the value with key arrows:
  • Holding shift would do so by 1.0 instead of 0.1
  • Holding alt would be by 0.05 instead of 0.1
  • Holding ctrl/cmd would go by 10% of the range instead of by value. Limited to range [0.0, 100.0]
yum13241
Posts: 781
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support
Contact:

Re: Shift/Alt/ctrl key support for Menu Sliders/numbers

Post by yum13241 »

I second this, it would be very useful if it gets added in.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Shift/Alt/ctrl key support for Menu Sliders/numbers

Post by Marisa the Magician »

I've already implemented something like this myself on one of my mods and it sure helps a lot with the sliders that have really tiny increments.

It requires changes in the options menu itself because items themselves have no way to read the state of those three keys otherwise.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Shift/Alt/ctrl key support for Menu Sliders/numbers

Post by Major Cooke »

Marisa Kirisame wrote:I've already implemented something like this myself on one of my mods and it sure helps a lot with the sliders that have really tiny increments.

It requires changes in the options menu itself because items themselves have no way to read the state of those three keys otherwise.
Can you show me in particular? If this can be done, I could reform it and make a proper submission for it, giving credit to you of course.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Shift/Alt/ctrl key support for Menu Sliders/numbers

Post by Marisa the Magician »

Relevant code for how I did it here.

It's hacky and there's probably a better way to do this than to pass the modifiers to all items in a loop.
Post Reply

Return to “Feature Suggestions [GZDoom]”