android 自定義軟鍵盤keys not working correctly

from stackoverflow.com/a/24065660java

//覆蓋Keyboard的getNearestKeys方法便可
@Override
public int[] getNearestKeys(int x, int y) {
    List<Key> keys = getKeys();
    for (int i = 0; i < keys.size(); i++) {
        if (keys.get(i).isInside(x, y)) return new int[]{i};
    }
    return new int[0];
}

複製代碼
相關文章
相關標籤/搜索