MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / keyPressed

Method keyPressed

CodenameOne/src/com/codename1/ui/MenuBar.java:1305–1329  ·  view source on GitHub ↗
(int keyCode)

Source from the content-addressed store, hash-verified

1303
1304 /// {@inheritDoc}
1305 @Override
1306 public void keyPressed(int keyCode) {
1307 int commandBehavior = getCommandBehavior();
1308 if (commandBehavior >= Display.COMMAND_BEHAVIOR_BUTTON_BAR) {
1309 return;
1310 }
1311 if (getCommandCount() > 0) {
1312 if (isLSK(keyCode)) {
1313 if (left != null) {
1314 left.pressed();
1315 }
1316 } else {
1317 // it might be a back command or the fire...
1318 if (isRSK(keyCode)) {
1319 if (right != null) {
1320 right.pressed();
1321 }
1322 } else {
1323 if (Display.getInstance().getGameAction(keyCode) == Display.GAME_FIRE) {
1324 main.pressed();
1325 }
1326 }
1327 }
1328 }
1329 }
1330
1331 /// {@inheritDoc}
1332 @Override

Callers

nothing calls this directly

Calls 7

getCommandBehaviorMethod · 0.95
getCommandCountMethod · 0.95
isLSKMethod · 0.95
isRSKMethod · 0.95
getInstanceMethod · 0.95
pressedMethod · 0.45
getGameActionMethod · 0.45

Tested by

no test coverage detected