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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user