Package me.hackware.api.gui
Class Keycap
java.lang.Object
me.hackware.api.gui.Keycap
Shared docs-site
<kbd>-style keycap rendering plus key-combo label
helpers, reused by the sidebar rows, filter hints and the KeybindInput
recorder so keycaps look identical everywhere.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncomboParts(int mods, int code) Keycap labels for a stored combo: modifiers in order, then the main key.static voiddashedRect(UiContext ui, int x, int y, int w, int h, int dash, int gap, int color) A 1px dotted rectangle border (dashon,gapoff).static intA raised keycap: an elevated face over a darker base edge peeking out below, like a physical key.static intDashed ghost keycap: muted text inside a dotted border, no face or shadow.static intdrawIcon(UiContext ui, int x, int capY, Icons.Icon icon, float alpha) Asdraw(me.hackware.api.gui.UiContext, int, int, java.lang.String, float), but the face carries a tinted icon sprite — used for modifiers that have a glyph rather than a name (macOS ⌘).static intWidth of a keycap whose face carries an icon rather than a label: square, so the glyph gets the same padding on every side.static StringPlatform name of the OS/super modifier.static intWidth of a keycap forlabel(text + horizontal padding).
-
Field Details
-
HEIGHT
public static final int HEIGHTKeycap face height in logical px.- See Also:
-
-
Method Details
-
width
Width of a keycap forlabel(text + horizontal padding). -
draw
A raised keycap: an elevated face over a darker base edge peeking out below, like a physical key.capYis the face top; returns the x after it plus spacing. -
iconWidth
public static int iconWidth()Width of a keycap whose face carries an icon rather than a label: square, so the glyph gets the same padding on every side. Text caps pad their label horizontally instead, which on a glyph as wide as it is tall just reads as a stretched cap. -
drawIcon
Asdraw(me.hackware.api.gui.UiContext, int, int, java.lang.String, float), but the face carries a tinted icon sprite — used for modifiers that have a glyph rather than a name (macOS ⌘). Same face, base edge and spacing, so it lines up with text caps in the same run. -
drawGhost
Dashed ghost keycap: muted text inside a dotted border, no face or shadow. -
dashedRect
public static void dashedRect(UiContext ui, int x, int y, int w, int h, int dash, int gap, int color) A 1px dotted rectangle border (dashon,gapoff). -
superName
Platform name of the OS/super modifier. -
comboParts
Keycap labels for a stored combo: modifiers in order, then the main key.
-