Fix typos and build errors

This commit is contained in:
Henrik Grimler
2018-08-01 15:19:33 +02:00
committed by Fredrik Fornwall
parent c24167f6a5
commit 9db8948f23

View File

@@ -98,7 +98,7 @@ public final class ExtraKeysView extends GridLayout {
ToggleButton button = null; ToggleButton button = null;
} }
private Map<String, Boolean> specialButtons = new HashMap<String, Boolean>() {{ private Map<SpecialButton, SpecialButtonState> specialButtons = new HashMap<SpecialButton, SpecialButtonState>() {{
put(SpecialButton.CTRL, new SpecialButtonState()); put(SpecialButton.CTRL, new SpecialButtonState());
put(SpecialButton.ALT, new SpecialButtonState()); put(SpecialButton.ALT, new SpecialButtonState());
put(SpecialButton.FN, new SpecialButtonState()); put(SpecialButton.FN, new SpecialButtonState());
@@ -110,12 +110,12 @@ public final class ExtraKeysView extends GridLayout {
/** @deprecated, call readSpecialButton(SpecialButton.CTRL); */ /** @deprecated, call readSpecialButton(SpecialButton.CTRL); */
public boolean readControlButton() { public boolean readControlButton() {
return readSpecialButton(SpecialButton.FN); return readSpecialButton(SpecialButton.CTRL);
} }
/** @deprecated, call readSpecialButton(SpecialButton.ALT); */ /** @deprecated, call readSpecialButton(SpecialButton.ALT); */
public boolean readAltButton() { public boolean readAltButton() {
return readSpecialButton(SpecialButton.FN); return readSpecialButton(SpecialButton.ALT);
} }
/** @deprecated, call readSpecialButton(SpecialButton.FN); */ /** @deprecated, call readSpecialButton(SpecialButton.FN); */
@@ -126,7 +126,7 @@ public final class ExtraKeysView extends GridLayout {
public boolean readSpecialButton(SpecialButton name) { public boolean readSpecialButton(SpecialButton name) {
SpecialButtonState state = specialButtons.get(name); SpecialButtonState state = specialButtons.get(name);
if(state == null) if(state == null)
throw Exception("Must be a valid special button (see source)"); throw new RuntimeException("Must be a valid special button (see source)");
if (! state.isOn) if (! state.isOn)
return false; return false;
@@ -179,6 +179,7 @@ public final class ExtraKeysView extends GridLayout {
put("TAB", ""); // U+21B9 ↹ LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR put("TAB", ""); // U+21B9 ↹ LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR
put("BKSP", ""); // U+232B ⌫ ERASE TO THE LEFT sometimes seen and easy to understand put("BKSP", ""); // U+232B ⌫ ERASE TO THE LEFT sometimes seen and easy to understand
put("DEL", ""); // U+2326 ⌦ ERASE TO THE RIGHT not well known but easy to understand put("DEL", ""); // U+2326 ⌦ ERASE TO THE RIGHT not well known but easy to understand
}};
static final CharDisplayMap lessKnownCharactersDisplay = new CharDisplayMap() {{ static final CharDisplayMap lessKnownCharactersDisplay = new CharDisplayMap() {{
// https://en.wikipedia.org/wiki/{Home_key, End_key, Page_Up_and_Page_Down_keys} // https://en.wikipedia.org/wiki/{Home_key, End_key, Page_Up_and_Page_Down_keys}