示例#1
0
 @Override
 boolean mnemonicMatch(char key) {
   char uckey = Character.toUpperCase(key);
   String parsedText = layout.getText();
   for (int i = 0; i < mnemonics.length - 1; i++) {
     if (mnemonics[i] != -1) {
       char mnemonic = parsedText.charAt(mnemonics[i]);
       if (uckey == Character.toUpperCase(mnemonic)) {
         return true;
       }
     }
   }
   return false;
 }
示例#2
0
 @Override
 boolean mnemonicHit(char key) {
   char uckey = Character.toUpperCase(key);
   String parsedText = layout.getText();
   for (int i = 0; i < mnemonics.length - 1; i++) {
     if (mnemonics[i] != -1) {
       char mnemonic = parsedText.charAt(mnemonics[i]);
       if (uckey == Character.toUpperCase(mnemonic)) {
         if (!setFocus()) return false;
         focusIndex = i;
         redraw();
         return true;
       }
     }
   }
   return false;
 }