当前位置: 首页>>代码示例>>Java>>正文


Java KeyEvent.KEY_LOCATION_UNKNOWN属性代码示例

本文整理汇总了Java中java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.KEY_LOCATION_UNKNOWN属性的具体用法?Java KeyEvent.KEY_LOCATION_UNKNOWN怎么用?Java KeyEvent.KEY_LOCATION_UNKNOWN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.event.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.KEY_LOCATION_UNKNOWN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getText

private String getText() {
    CharArray ltrChars = new CharArray();
    String text = "";

    // add only LTR characters into array.
    for (int i = glyphs.size - 1; i >= 0; i--) {
        if (glyphs.get(i).isRTL()) break;

        ltrChars.add(glyphs.get(i).getOriginalChar());
    }

    // fix space between RTL and LTR characters.
    fixSpace(ltrChars);

    // reverse LTR characters and update main glyphs.
    for (int i = glyphs.size - 1; i >= 0; i--) {
        if (glyphs.get(i).isRTL()) break;

        glyphs.get(i).setChar(ltrChars.pop());
    }

    // append glyphs together.
    for (int i = glyphs.size - 1; i >= 0; i--) {
        char c = glyphs.get(i).getChar();
        text += c == KeyEvent.KEY_LOCATION_UNKNOWN ? KeyEvent.VK_SPACE : c;
    }

    return text;
}
 
开发者ID:CrowniAPIs,项目名称:libGDX-RTL-Language,代码行数:29,代码来源:ArFont.java

示例2: fixSpace

/**
 * This method can fix approximately the space between RTL and LTR characters.
 *
 * @param ltrChars contains LTR characters ONLY.
 */
private void fixSpace(CharArray ltrChars) {
    if (ltrChars.size > 0)
        if (ltrChars.first() == KeyEvent.VK_SPACE || ltrChars.first() == KeyEvent.KEY_LOCATION_UNKNOWN) {
            if (ltrChars.first() == KeyEvent.VK_SPACE && ltrChars.peek() == KeyEvent.VK_SPACE)
                return;
            ltrChars.add(ltrChars.removeIndex(0));

        } else if (ltrChars.peek() == KeyEvent.VK_SPACE || ltrChars.peek() == KeyEvent.KEY_LOCATION_UNKNOWN)
            ltrChars.insert(0, ltrChars.pop());

}
 
开发者ID:CrowniAPIs,项目名称:libGDX-RTL-Language,代码行数:16,代码来源:ArFont.java

示例3: create

public final KeyEvent create(int id, int keyCode, char c) {
    return new KeyEvent(component, id, System.currentTimeMillis(), 0, keyCode, c,
            id != KeyEvent.KEY_TYPED ? KeyEvent.KEY_LOCATION_STANDARD : KeyEvent.KEY_LOCATION_UNKNOWN);
}
 
开发者ID:Parabot,项目名称:Parabot-317-API-Minified-OS-Scape,代码行数:4,代码来源:InternalKeyboard.java


注:本文中的java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。