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


Java MetaKeyKeyListener.adjustMetaAfterKeypress方法代码示例

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


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

示例1: onKeyDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
@Override
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if (!m_started)
            return false;
        m_metaState = MetaKeyKeyListener.handleKeyDown(m_metaState, keyCode, event);
        int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(m_metaState));
        int lc=c;
        m_metaState = MetaKeyKeyListener.adjustMetaAfterKeypress(m_metaState);

        if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0)
        {
            c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
            int composed = KeyEvent.getDeadChar(m_lastChar, c);
            c = composed;
        }
        m_lastChar = lc;
//        if (keyCode != KeyEvent.KEYCODE_BACK)
                QtApplication.keyDown(keyCode, c, event.getMetaState());
        return true;
    }
 
开发者ID:harmattan,项目名称:uds,代码行数:22,代码来源:QtActivity.java

示例2: translateKeyDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
 * This translates incoming hard key events in to edit operations on an
 * InputConnection.  It is only needed when using the
 * PROCESS_HARD_KEYS option.
 */
private boolean translateKeyDown(int keyCode, KeyEvent event) {
    mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
            keyCode, event);
    int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
    mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
    InputConnection ic = getCurrentInputConnection();
    if (c == 0 || ic == null) {
        return false;
    }

    boolean dead = false;

    if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
        dead = true;
        c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
    }

    if (mComposing.length() > 0) {
        char accent = mComposing.charAt(mComposing.length() -1 );
        int composed = KeyEvent.getDeadChar(accent, c);

        if (composed != 0) {
            c = composed;
            mComposing.setLength(mComposing.length()-1);
        }
    }

    onKey(c, null);

    return true;
}
 
开发者ID:VladThodo,项目名称:behe-keyboard,代码行数:37,代码来源:PCKeyboard.java

示例3: translateKeyDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
     * This translates incoming hard key events in to edit operations on an
     * InputConnection.  It is only needed when using the
     * PROCESS_HARD_KEYS option.
     */
    private boolean translateKeyDown(int keyCode, KeyEvent event) {
//        Log.v("SpartacusRex","SOFT : translateKeyDown "+keyCode);

        mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
                keyCode, event);
        int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
        mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
        InputConnection ic = getCurrentInputConnection();
        if (c == 0 || ic == null) {
            return false;
        }

        boolean dead = false;

        if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
            dead = true;
            c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
        }

        if (mComposing.length() > 0) {
            char accent = mComposing.charAt(mComposing.length() - 1);
            int composed = KeyEvent.getDeadChar(accent, c);

            if (composed != 0) {
                c = composed;
                mComposing.setLength(mComposing.length() - 1);
            }
        }

        onKey(c, null);

        return true;
    }
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:39,代码来源:TerminalKeyboard.java

示例4: translateKeyDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
 * This translates incoming hard key events in to edit operations on an
 * InputConnection.  It is only needed when using the
 * PROCESS_HARD_KEYS option.
 */
private boolean translateKeyDown(int keyCode, KeyEvent event) {
    mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
            keyCode, event);
    int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
    mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
    InputConnection ic = getCurrentInputConnection();
    if (c == 0 || ic == null) {
        return false;
    }
    
    boolean dead = false;

    if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
        dead = true;
        c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
    }
    
    if (mComposing.length() > 0) {
        char accent = mComposing.charAt(mComposing.length() -1 );
        int composed = KeyEvent.getDeadChar(accent, c);

        if (composed != 0) {
            c = composed;
            mComposing.setLength(mComposing.length()-1);
        }
    }
    
    onKey(c, null);
    
    return true;
}
 
开发者ID:iamironrabbit,项目名称:tibetan-keyboard,代码行数:37,代码来源:SoftKeyboard.java

示例5: onKeyDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
public boolean onKeyDown(TextView widget, Spannable buffer, int keyCode, KeyEvent event) {
    if (executeDown(widget, buffer, keyCode,event)) {
        MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
        resetLockedMeta(buffer);
        return true;
    }

    return false;
}
 
开发者ID:jiro-aqua,项目名称:JotaTextEditor,代码行数:10,代码来源:ArrowKeyMovementMethod.java

示例6: translateKeyDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
     * This translates incoming hard key events in to edit operations on an
     * InputConnection.  It is only needed when using the
     * PROCESS_HARD_KEYS option.
     */
    private boolean translateKeyDown(int keyCode, KeyEvent event) {
//        Log.v("SpartacusRex","SOFT : translateKeyDown "+keyCode);

        mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
                keyCode, event);
        int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
        mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
        InputConnection ic = getCurrentInputConnection();
        if (c == 0 || ic == null) {
            return false;
        }
        
        boolean dead = false;

        if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
            dead = true;
            c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
        }
        
        if (mComposing.length() > 0) {
            char accent = mComposing.charAt(mComposing.length() -1 );
            int composed = KeyEvent.getDeadChar(accent, c);

            if (composed != 0) {
                c = composed;
                mComposing.setLength(mComposing.length()-1);
            }
        }
        
        onKey(c, null);
        
        return true;
    }
 
开发者ID:dyne,项目名称:ZShaolin,代码行数:39,代码来源:TerminalKeyboard.java

示例7: translateKeyDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private boolean translateKeyDown(int keyCode, KeyEvent event) {
	MetaState = MetaKeyKeyListener.handleKeyDown(MetaState,
			keyCode, event);
	int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(MetaState));
	MetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(MetaState);
	InputConnection ic = getCurrentInputConnection();
	if (c == 0 || ic == null) {
		return false;
	}

	dead = false;

	if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
		dead = true;
		c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
	}

	if (Composing.length() > 0) {
		char accent = Composing.charAt(Composing.length() -1 );
		int composed = KeyEvent.getDeadChar(accent, c);

		if (composed != 0) {
			c = composed;
			Composing.setLength(Composing.length()-1);
		}
	}

	onKey(c, null);

	return true;
}
 
开发者ID:ghwoni13,项目名称:BAGO_TS,代码行数:32,代码来源:KeyboardService.java

示例8: getUnicodeChar

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private int getUnicodeChar(int keyCode, KeyEvent event) {
    mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState, keyCode, event);
    int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
    mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
    return c;
}
 
开发者ID:macacajs,项目名称:android-unicode,代码行数:7,代码来源:Utf7ImeService.java

示例9: executeDown

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private boolean executeDown(TextView widget, Spannable buffer, int keyCode , KeyEvent event) {
    boolean handled = false;

    if ( keyCode == KEYCODE_PAGE_UP ){
        handled |= volup(widget, buffer);
    }else if ( keyCode == KEYCODE_PAGE_DOWN){
        handled |= voldown(widget, buffer);
    }else if ( keyCode == KEYCODE_MOVE_HOME){
        handled |= movehome(widget, buffer ,event);
    }else if ( keyCode == KEYCODE_MOVE_END){
        handled |= moveend(widget, buffer , event);
    }else{
        switch (keyCode) {
        case KeyEvent.KEYCODE_DPAD_UP:
            handled |= up(widget, buffer);
            break;

        case KeyEvent.KEYCODE_DPAD_DOWN:
            handled |= down(widget, buffer);
            break;

        case KeyEvent.KEYCODE_DPAD_LEFT:
            handled |= left(widget, buffer);
            break;

        case KeyEvent.KEYCODE_DPAD_RIGHT:
            handled |= right(widget, buffer);
            break;

        case KeyEvent.KEYCODE_DPAD_CENTER:
            if (JotaTextKeyListener.getMetaStateSelecting(buffer) != 0) {
                if (widget.showContextMenu()) {
                    handled = true;
                }
            }
            break;
        case KeyEvent.KEYCODE_VOLUME_UP:
            if ( sUseVolumeKey ){
                handled |= volup(widget, buffer);
            }
            break;
        case KeyEvent.KEYCODE_VOLUME_DOWN:
            if ( sUseVolumeKey ){
                handled |= voldown(widget, buffer);
            }
            break;
        }
    }
    if (handled) {
        MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
        resetLockedMeta(buffer);
    }

    return handled;
}
 
开发者ID:jiro-aqua,项目名称:JotaTextEditor,代码行数:56,代码来源:ArrowKeyMovementMethod.java

示例10: getUnicodeChar

import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private int getUnicodeChar(int keyCode, KeyEvent event) {
    metaState = MetaKeyKeyListener.handleKeyDown(metaState, keyCode, event);
    int c = event.getUnicodeChar(event.getMetaState());
    metaState = MetaKeyKeyListener.adjustMetaAfterKeypress(metaState);
    return c;
}
 
开发者ID:appium,项目名称:io.appium.android.ime,代码行数:7,代码来源:UnicodeIME.java


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