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

Method keyReleased

CodenameOne/src/com/codename1/ui/List.java:900–925  ·  view source on GitHub ↗
(int keyCode)

Source from the content-addressed store, hash-verified

898
899 /// {@inheritDoc}
900 @Override
901 public void keyReleased(int keyCode) {
902 // other events are in keyReleased to prevent the next event from reaching the next form
903 int gameAction = Display.getInstance().getGameAction(keyCode);
904 if (gameAction == Display.GAME_FIRE) {
905 boolean h = handlesInput();
906 setHandlesInput(!h);
907 if (h) {
908 fireActionEvent();
909 }
910 repaint();
911 return;
912 }
913
914 if (numericKeyActions && gameAction != Display.GAME_LEFT &&
915 gameAction != Display.GAME_RIGHT && gameAction != Display.GAME_UP &&
916 gameAction != Display.GAME_DOWN) {
917 if (keyCode >= '1' && keyCode <= '9') {
918 int offset = keyCode - '1';
919 if (offset < getModel().getSize()) {
920 setSelectedIndex(offset);
921 fireActionEvent();
922 }
923 }
924 }
925 }
926
927 /// {@inheritDoc}
928 @Override

Callers

nothing calls this directly

Calls 9

getInstanceMethod · 0.95
setHandlesInputMethod · 0.95
fireActionEventMethod · 0.95
getModelMethod · 0.95
setSelectedIndexMethod · 0.95
repaintMethod · 0.65
getSizeMethod · 0.65
getGameActionMethod · 0.45
handlesInputMethod · 0.45

Tested by

no test coverage detected