本文整理汇总了C#中Android.Views.KeyEvent类的典型用法代码示例。如果您正苦于以下问题:C# KeyEvent类的具体用法?C# KeyEvent怎么用?C# KeyEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyEvent类属于Android.Views命名空间,在下文中一共展示了KeyEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnKeyUp
public override bool OnKeyUp(Keycode keyCode, KeyEvent keyEvent)
{
//Log.Info(TAG, "OnKeyUp=" + (int)keyCode);
int playerNum = OuyaController.getPlayerNumByDeviceId(keyEvent.DeviceId);
if (playerNum >= 0 && playerNum < 4)
{
if ((int)keyCode == OuyaController.BUTTON_DPAD_DOWN)
{
_game.GetFocusManager().FocusDown();
}
if ((int)keyCode == OuyaController.BUTTON_DPAD_LEFT)
{
_game.GetFocusManager().FocusLeft();
}
if ((int)keyCode == OuyaController.BUTTON_DPAD_RIGHT)
{
_game.GetFocusManager().FocusRight();
}
if ((int)keyCode == OuyaController.BUTTON_DPAD_UP)
{
_game.GetFocusManager().FocusUp();
}
if ((int)keyCode == OuyaController.BUTTON_O)
{
_game.GetFocusManager().InvokeClick();
}
if ((int)keyCode == OuyaController.BUTTON_A)
{
_game.Exit();
}
}
return true;
}
开发者ID:BattleJenkins,项目名称:ouya-sdk-examples,代码行数:33,代码来源:Activity1.cs
示例2: OnKey
public bool OnKey(View v, Keycode keyCode, KeyEvent e)
{
if (e.KeyCode == Keycode.Enter && e.Action == 0) {
activity.EnterKeyPressed ();
}
return false;
}
开发者ID:jkstrawn,项目名称:wanikani_android,代码行数:7,代码来源:KeyListeners.cs
示例3: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
mKeyboard = new Keyboard(this, Resource.Xml.keyboard2);
mTargetView = (EditText)FindViewById(Resource.Id.target);
mKeyboardView = (CustomKeyboardView)FindViewById(Resource.Id.keyboard_view);
mKeyboardView.Keyboard = mKeyboard;
mTargetView.Touch += (sender, e) => {
Log.Info("onTouch", "true");
ShowKeyboardWithAnimation();
e.Handled = true;
};
mKeyboardView.Key += (sender, e) => {
long eventTime = JavaSystem.CurrentTimeMillis();
KeyEvent ev = new KeyEvent(eventTime, eventTime, KeyEventActions.Down, e.PrimaryCode, 0, 0, 0, 0, KeyEventFlags.SoftKeyboard | KeyEventFlags.KeepTouchMode);
this.DispatchKeyEvent(ev);
};
}
开发者ID:Vaikesh,项目名称:CustomKeyboard,代码行数:26,代码来源:Activity1.cs
示例4: OnKeyDown
public bool OnKeyDown (Android.Views.Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Menu)
return true;
return false;
}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:7,代码来源:ActivityHelper.cs
示例5: OnKeyUp
public override bool OnKeyUp(Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back)
return base.OnKeyUp (keyCode, e);
else
return jetboy_thread.DoKeyUp (keyCode, e);
}
开发者ID:rudini,项目名称:monodroid-samples,代码行数:7,代码来源:JetBoyActivity.cs
示例6: OnKeyDown
// If Back button is pressed, return previous fragment.
public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back) {
return PopFragment();
}
return base.OnKeyDown(keyCode, e);
}
开发者ID:sloscialo,项目名称:EllipticalWorkout,代码行数:9,代码来源:ActivityBase.cs
示例7: DispatchKeyEvent
public override bool DispatchKeyEvent(KeyEvent keyEvent)
{
if (null != _ouyaInputView)
{
return _ouyaInputView.DispatchKeyEvent(keyEvent);
}
return base.DispatchKeyEvent(keyEvent);
}
开发者ID:thoniorf,项目名称:ouya-sdk-examples,代码行数:8,代码来源:Activity1.cs
示例8: OnKeyDown
public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back) {
Finish ();
}
return base.OnKeyDown (keyCode, e);
}
开发者ID:WenF,项目名称:SSCA_FlagThis,代码行数:8,代码来源:MessageActivity.cs
示例9: SendKeyEvent
public override bool SendKeyEvent(KeyEvent e)
{
if (e.Action == KeyEventActions.Down && e.KeyCode == Keycode.Del)
{
noCursorMovingEditText.OnBackKeyPressed();
}
return base.SendKeyEvent(e);
}
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:9,代码来源:NoCursorMovingEditText.cs
示例10: OnKeyUp
public bool OnKeyUp(Keycode keycode, KeyEvent keyEvent)
{
if (keycode == Keycode.Back && _slidingMenu.IsMenuShowing)
{
ShowContent();
return true;
}
return false;
}
开发者ID:bobRafat,项目名称:vvchart,代码行数:9,代码来源:SlidingActivityHelper.cs
示例11: DispatchKeyEvent
public override bool DispatchKeyEvent(KeyEvent e)
{
if (_contentView != null)
{
_contentView.View.DispatchKeyEvent(e);
}
return base.DispatchKeyEvent(e);
}
开发者ID:Arlorean,项目名称:Perspex,代码行数:9,代码来源:PerspexActivity.cs
示例12: OnKeyLongPress
public bool OnKeyLongPress (Android.Views.Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back) {
GoHome ();
return true;
}
return false;
}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:9,代码来源:ActivityHelper.cs
示例13: OnKeyDown
public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back && WaveServices.Platform != null)
{
WaveServices.Platform.Exit();
}
return base.OnKeyDown(keyCode, e);
}
开发者ID:123asd123A,项目名称:Samples,代码行数:9,代码来源:App.cs
示例14: OnEditorAction
public bool OnEditorAction(TextView v, ImeAction actionId, KeyEvent e)
{
if (actionId == ImeAction.Search)
{
ViewModel.SearchCommand.Execute(null);
return true;
}
return false;
}
开发者ID:AlexanderGrant1,项目名称:PropertyCross,代码行数:9,代码来源:PropertyFinderView.cs
示例15: OnKeyUp
public override bool OnKeyUp(Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back)
{
WaveEngine.Adapter.Input.InputManager inputManager = (WaveEngine.Adapter.Input.InputManager)adapter.InputManager;
inputManager.GamePadState.Buttons.Back = ButtonState.Release;
}
return true;
}
开发者ID:noatom,项目名称:Samples,代码行数:9,代码来源:GLView.cs
示例16: DispatchKeyEvent
public override bool DispatchKeyEvent (KeyEvent e)
{
if (e.KeyCode == Keycode.Back && !isMapOpen) {
horizontalMenu.RestoreInitalState ();
return true;
} else {
return base.DispatchKeyEvent (e);
}
}
开发者ID:Gerhic,项目名称:Need2Park,代码行数:9,代码来源:MainView.cs
示例17:
bool View.IOnKeyListener.OnKey (View v, Keycode keyCode, KeyEvent e)
{
if (e.Action == KeyEventActions.Down && keyCode == Keycode.Enter) {
Logger.Debug ("entered pressed");
OnSend ();
return true;
}
return false;
}
开发者ID:SeanmanX,项目名称:opandroid,代码行数:9,代码来源:ChatActivity.cs
示例18: OnKeyDown
public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back) {
oauthWebView.close (true);
return true;
} else {
return base.OnKeyDown (keyCode, e);
}
}
开发者ID:secondsun,项目名称:fh-dotnet-sdk,代码行数:9,代码来源:FHOAuthIntent.cs
示例19: OnKeyDown
public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Menu) {
StartActivity (typeof(SettingsActivity));
return true;
}
return base.OnKeyDown (keyCode, e);
}
开发者ID:Redth,项目名称:FlamedTVLauncher,代码行数:9,代码来源:MainActivity.cs
示例20: OnKeyUp
public override bool OnKeyUp (Keycode keyCode, KeyEvent e)
{
if (keyCode == Keycode.Back) {
Intent intent = new Intent(Intent.ActionMain);
intent.AddCategory(Intent.CategoryHome);
intent.SetFlags(ActivityFlags.NewTask);
StartActivity(intent);
}
return true;
}
开发者ID:borain89vn,项目名称:demo2,代码行数:10,代码来源:MyProfileActivity.cs
注:本文中的Android.Views.KeyEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论