MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / processKeys

Method processKeys

src/org/albite/albite/BookCanvas.java:1170–1224  ·  view source on GitHub ↗
(final int k, final boolean repeated)

Source from the content-addressed store, hash-verified

1168 }
1169
1170 private void processKeys(final int k, final boolean repeated) {
1171
1172 int kga = getGameAction(k);
1173
1174 if (mode == MODE_PAGE_READING) {
1175
1176 if (kga == (scrollingOnX ? LEFT : UP)) {
1177 scheduleScrolling(SCROLL_PREV);
1178 return;
1179 }
1180
1181 if (kga == (scrollingOnX ? RIGHT : DOWN)) {
1182 scheduleScrolling(SCROLL_NEXT);
1183 return;
1184 }
1185
1186 if (!repeated) {
1187 if (kga == FIRE) {
1188 /*
1189 * Menu
1190 */
1191 app.calledOutside();
1192 app.showMenu();
1193 return;
1194 }
1195
1196 switch (k) {
1197 case KEY_NUM1:
1198 //open library
1199 app.calledOutside();
1200 app.openLibrary();
1201 return;
1202
1203 case KEY_NUM3:
1204 //open dictionary and unit converter
1205 app.calledOutside();
1206 app.setEntryForLookup("");
1207 //#if (TinyMode || TinyModeExport || LightMode || LightModeExport)
1208//# app.enterNumber();
1209 //#else
1210 app.enterWord();
1211 //#endif
1212 return;
1213
1214 case KEY_NUM7:
1215 cycleFontSizes();
1216 return;
1217
1218 case KEY_NUM9:
1219 cycleColorSchemes();
1220 return;
1221 }
1222 }
1223 }
1224 }
1225
1226 public final boolean isBookOpen(final String bookURL) {
1227

Callers 1

runMethod · 0.95

Calls 8

scheduleScrollingMethod · 0.95
cycleFontSizesMethod · 0.95
cycleColorSchemesMethod · 0.95
calledOutsideMethod · 0.80
showMenuMethod · 0.80
openLibraryMethod · 0.80
setEntryForLookupMethod · 0.80
enterWordMethod · 0.80

Tested by

no test coverage detected