Settings UI
How the InputBooster settings screens are built: the panel layout, the seven tabs, the profiles screen and the alpha warning.
The settings screen is hand-built on Minecraft's Screen API. There is no
widget library and no layout engine: every row is placed by coordinate.
The panel
The screen draws a floating panel over the vanilla options screen rather than replacing it.
| Constant | Value | Purpose |
|---|---|---|
RAIL_WIDTH | 100 | The width of the tab rail |
HEADER_H | 44 | The header height, which is also the drag area |
MIN_PANEL_W | 380 | The minimum width |
MIN_PANEL_H | 260 | The minimum height |
The panel opens at up to 560 x 460, clamped to the window. The position is centred on the first open.
int maxW = Math.max(MIN_PANEL_W, this.width - 16); int maxH = Math.max(MIN_PANEL_H, this.height - 8); panelW = savedPanelW == 0 ? Math.min(560, maxW) : clamp(savedPanelW, MIN_PANEL_W, maxW); panelH = savedPanelH == 0 ? Math.min(460, maxH) : clamp(savedPanelH, MIN_PANEL_H, maxH);
Moving and resizing
| Gesture | Result |
|---|---|
| Drag inside the header | Moves the panel |
| Drag the bottom-right grip | Resizes the panel, down to 380 x 260 |
| Wheel over the content | Scrolls the content |
| Drag the scrollbar | Scrolls the content |
The content area scrolls; the tab rail and the footer do not. Rows that do not fit the viewport are hidden rather than drawn over the header or the footer.
Session-only geometry
The size and position are held in static fields:
private static int savedPanelW, savedPanelH; private static int savedPanelX = Integer.MIN_VALUE; private static int savedPanelY = Integer.MIN_VALUE;
They survive closing and reopening the screen within one session and are never written to the config file. A view preference is not a mod setting.
The seven tabs
private enum Tab { OVERVIEW("Overview"), KEYBOARD("Keyboard"), MOUSE("Mouse"), OVERLAY("Overlay"), PERFORMANCE("Performance"), COMPATIBILITY("Compatibility"), ADVANCED("Advanced"); }
Each tab has a one-line description under its name in the rail, for example
Live state, active features, session summary for Overview and
Other input mods and fallback behaviour for Compatibility.
Switching tabs rebuilds the widgets:
switch (tab) { case OVERVIEW -> buildOverview(); case KEYBOARD -> buildKeyboard(); ... }
Widgets
The screen uses four custom widget types, all built in the same file.
| Widget | Behaviour |
|---|---|
SettingSlider | Integer-backed. Floats are stored as hundredths, so overlay_scale is a slider from 50 to 300 |
| Toggle | A button that flips a boolean config value |
| Action button | Runs a lambda — resync, reset counters, open the profiles screen |
| Text row | A label drawn directly, not as a widget |
Every widget writes a real config value through the setter, and sets
hasChanges = true.
Saving and closing
@Override public void onClose() { if (hasChanges) InputBoosterConfig.save(); if (this.minecraft != null) this.minecraft.setScreenAndShow(parent); }
The footer has two buttons:
| Button | Behaviour |
|---|---|
| Save & Close | Saves if anything changed, then closes |
| Close | Closes without forcing a save |
Because the values apply immediately, "Close" only skips the write. The file is written again at shutdown.
The profiles screen
ProfilesScreen is a separate screen with the same visual language: one back
button, the same palette, the same row rhythm.
It offers a Save button per profile, a Load button and a Delete button per profile, and a Back button. It is reached from the Advanced tab through Manage profiles.
The alpha warning screen
KeyboardHandlerWarningScreen is shown before the custom keyboard handler is
enabled. It exists because the handler is alpha: an untested Minecraft or mod
combination can route input differently, and the handler may then pass a key
twice or drop it.
While the handler is on, a red line stays on the settings screen and the overlay adds a warning line.
Related pages
- The settings screen — the player-facing tour.
- Feature managers — what a control has to be wired to.
- Mixin inventory — the mixin that adds the options button.