1
mirror of https://github.com/Shiewk/Widgets.git synced 2026-04-28 11:34:17 +02:00

Allow changing IntSliderWidgetSetting with arrow keys when focused

This commit is contained in:
Shy
2024-10-20 11:47:30 +02:00
parent eab6e2171c
commit 59acc266f2
@@ -24,6 +24,17 @@ public class IntSliderWidgetSetting extends WidgetSettingOption {
this.maxValue = maxValue;
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
if (maxValue > value && keyCode == 262) { // right arrow key
value++;
return true;
} else if (minValue < value && keyCode == 263){ // left arrow key
value--;
return true;
}
return false;
}
@Override
public JsonElement saveState() {