UI: Use powered slider repeat on all devices.

Some devices send through repeats, but we want to do the increased speed
thing.  It might be ideal to use its repeat rate settings, but we don't
have a good way to do that cross platform...

Fixes #8696.
This commit is contained in:
Unknown W. Brackets 2016-09-05 16:15:16 -07:00
parent 42f8bbde50
commit b3b96ad993

View File

@ -1019,7 +1019,7 @@ void TriggerButton::GetContentDimensions(const UIContext &dc, float &w, float &h
}
bool Slider::Key(const KeyInput &input) {
if (HasFocus() && (input.flags & KEY_DOWN)) {
if (HasFocus() && (input.flags & (KEY_DOWN | KEY_IS_REPEAT)) == KEY_DOWN) {
if (ApplyKey(input.keyCode)) {
Clamp();
repeat_ = 0;
@ -1132,7 +1132,7 @@ void Slider::GetContentDimensions(const UIContext &dc, float &w, float &h) const
}
bool SliderFloat::Key(const KeyInput &input) {
if (HasFocus() && (input.flags & KEY_DOWN)) {
if (HasFocus() && (input.flags & (KEY_DOWN | KEY_IS_REPEAT)) == KEY_DOWN) {
if (ApplyKey(input.keyCode)) {
Clamp();
repeat_ = 0;