android.inputmethodservice.Keyboard类的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中android.inputmethodservice.Keyboard类的一些代码示例,展示了Keyboard类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keyboard类的具体详情如下:
包路径:android.inputmethodservice.Keyboard
类名称:Keyboard

Keyboard介绍

暂无

代码示例

代码示例来源:origin: GitPhoenix/KeyboardView

/**
 * 初始化自定义键盘
 */
private void initEditView() {
  keyboardNumber = new Keyboard(context, R.xml.keyboard_number);
  keyboardEnglish = new Keyboard(context, R.xml.keyboard_english);
}

代码示例来源:origin: stackoverflow.com

case keycode:
 Keyboard currentKeyboard = mInputView.getKeyboard();
 List<Keyboard.Key> keys = currentKeyboard.getKeys();
 mInputView.invalidateKey(*keycode*);
 keys.get(*keycode*).label = null;
 key.get(*keycode*).icon = getResources().getDrawable(R.drawable.image);

代码示例来源:origin: PhilippC/keepass2android

@Override
public boolean setShifted(boolean shiftState) {
  boolean shiftChanged = false;
  if (mShiftKey != null) {
    if (shiftState == false) {
      shiftChanged = mShiftState != SHIFT_OFF;
      mShiftState = SHIFT_OFF;
      mShiftKey.on = false;
      mShiftKey.icon = mOldShiftIcon;
    } else {
      if (mShiftState == SHIFT_OFF) {
        shiftChanged = mShiftState == SHIFT_OFF;
        mShiftState = SHIFT_ON;
        mShiftKey.icon = mShiftLockIcon;
      }
    }
  } else {
    return super.setShifted(shiftState);
  }
  return shiftChanged;
}

代码示例来源:origin: PhilippC/keepass2android

/**
 * Returns the state of the shift key of the keyboard, if any.
 * @return true if the shift is in a pressed state, false otherwise. If there is
 * no shift key on the keyboard or there is no keyboard attached, it returns false.
 */
public boolean isShifted() {
  if (mKeyboard != null) {
    return mKeyboard.isShifted();
  }
  return false;
}

代码示例来源:origin: PhilippC/keepass2android

@Override
public boolean isShifted() {
  if (mShiftKey != null) {
    return mShiftState != SHIFT_OFF;
  } else {
    return super.isShifted();
  }
}

代码示例来源:origin: stackoverflow.com

var gameplayEvents = ["keyup", "keydown"];
var keyboard = new Keyboard();
keyboard.listen(canvas, gameplayEvents);

// ongameover
keyboard.ignore(canvas, gameplayEvents);

代码示例来源:origin: stackoverflow.com

Keyboard keyboard = keyboardView.getKeyboard();
List<Key> keys = keyboard.getKeys();

代码示例来源:origin: PhilippC/keepass2android

/**
 * Sets the state of the shift key of the keyboard, if any.
 * @param shifted whether or not to enable the state of the shift key
 * @return true if the shift key state changed, false if there was no change
 */
public boolean setShifted(boolean shifted) {
  if (mKeyboard != null) {
    if (mKeyboard.setShifted(shifted)) {
      // The whole keyboard probably needs to be redrawn
      invalidateAllKeys();
      return true;
    }
  }
  return false;
}

代码示例来源:origin: PhilippC/keepass2android

protected CharSequence adjustCase(CharSequence label) {
  if (mKeyboard.isShifted() && label != null && label.length() < 3
      && Character.isLowerCase(label.charAt(0))) {
    return label.toString().toUpperCase(getKeyboardLocale());
  }
  return label;
}

代码示例来源:origin: stackoverflow.com

var kb = new Keyboard({
  defaultEventType: 'keypress'
});
kb.addEvents({
  'end': fnEnd,
});

代码示例来源:origin: stackoverflow.com

@Override
public void onPress(int primaryCode) 
{
  Keyboard currentKeyboard = mInputView.getKeyboard();            
  List<Keyboard.Key> keys = currentKeyboard.getKeys();
  mInputView.invalidateKey(primaryCode);

  for(int i = 0; i < keys.size() - 1; i++ )
  {
    Keyboard.Key currentKey = keys.get(i);

    //If your Key contains more than one code, then you will have to check if the codes array contains the primary code
    if(currentKey.codes[0] == primaryCode) 
    {
      currentKey.label = null;
      currentKey.icon = getResources().getDrawable(android.R.drawable.ic_dialog_email);
      break; // leave the loop once you find your match
    }
  }
}

代码示例来源:origin: stackoverflow.com

current.setShifted(false);

代码示例来源:origin: xudjx/djkeyboard

private CharSequence adjustCase(CharSequence label) {
    if (getKeyboard().isShifted() && label != null && label.length() < 3
        && Character.isLowerCase(label.charAt(0))) {
      label = label.toString().toUpperCase();
    }
    return label;
  }
}

代码示例来源:origin: stackoverflow.com

var k = new Keyboard();
document.body.appendChild(k.plus);
document.body.appendChild(k.minus);
document.body.appendChild(k.multi);
document.body.appendChild(k.divide);

代码示例来源:origin: PhilippC/keepass2android

public Key[] setKeyboard(Keyboard keyboard, float correctionX, float correctionY) {
  if (keyboard == null)
    throw new NullPointerException();
  mCorrectionX = (int)correctionX;
  mCorrectionY = (int)correctionY;
  mKeyboard = keyboard;
  List<Key> keys = mKeyboard.getKeys();
  Key[] array = keys.toArray(new Key[keys.size()]);
  mKeys = array;
  return array;
}

代码示例来源:origin: VladThodo/behe-keyboard

private void setCapsOn(boolean on) {
  /** Simple function that enables us to rapidly set the keyboard shifted or not.
   * */
  if(Variables.isShift()){
    kv.getKeyboard().setShifted(true);
    kv.invalidateAllKeys();
  }
  else {
    kv.getKeyboard().setShifted(on);
    kv.invalidateAllKeys();
  }
}
private void processKeyCombo(int keycode) {

代码示例来源:origin: PhilippC/keepass2android

@Override
protected CharSequence adjustCase(CharSequence label) {
  Keyboard keyboard = getKeyboard();
  if (keyboard.isShifted()
      && keyboard instanceof LatinKeyboard
      && ((LatinKeyboard) keyboard).isAlphaKeyboard()
      && !TextUtils.isEmpty(label) && label.length() < 3
      && Character.isLowerCase(label.charAt(0))) {
    return label.toString().toUpperCase(getKeyboardLocale());
  }
  return label;
}

代码示例来源:origin: vir56k/demo

public PopupKeyboardUtil(Activity mActivity) {
  this.mActivity = mActivity;
  this.keyboard = new Keyboard(mActivity, R.xml.small_keyboard);
}

代码示例来源:origin: zhuanghongji/custom-android-keyboard

private Keyboard.Key getKeyByKeyCode(int primaryCode) {
  if(null != mKeyboard){
    List<Key> keyList = mKeyboard.getKeys();
    for (int i =0,size= keyList.size(); i < size; i++) {
      Key key = keyList.get(i);
      int codes[] = key.codes;
      if(codes[0] == primaryCode){
        return key;
      }
    }
  }
  return null;
}

代码示例来源:origin: stackoverflow.com

keyboard.setShifted(caps);
keyview.invalidateAllKeys();

相关文章