本文整理汇总了Java中android.view.KeyEvent.metaStateHasNoModifiers方法的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.metaStateHasNoModifiers方法的具体用法?Java KeyEvent.metaStateHasNoModifiers怎么用?Java KeyEvent.metaStateHasNoModifiers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.metaStateHasNoModifiers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMovementKey
import android.view.KeyEvent; //导入方法依赖的package包/类
@Override
protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode,
int movementMetaState, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
if (KeyEvent.metaStateHasNoModifiers(movementMetaState)) {
if (event.getAction() == KeyEvent.ACTION_DOWN &&
event.getRepeatCount() == 0 && action(CLICK, widget, buffer)) {
return true;
}
}
break;
}
return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event);
}
示例2: handleMovementKey
import android.view.KeyEvent; //导入方法依赖的package包/类
@SuppressLint({"NewApi"})
protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode, int
movementMetaState, KeyEvent event) {
switch (keyCode) {
case 23:
case 66:
if (KeyEvent.metaStateHasNoModifiers(movementMetaState) && event.getAction() == 0
&& event.getRepeatCount() == 0 && action(1, widget, buffer)) {
return true;
}
}
return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event);
}
示例3: metaStateHasNoModifiers
import android.view.KeyEvent; //导入方法依赖的package包/类
public static boolean metaStateHasNoModifiers(int metaState) {
return KeyEvent.metaStateHasNoModifiers(metaState);
}