728x90
반응형
uwp 앱에서 코딩을 하지않아도 F7 키를 누르면 위와 같은 메시지가 뜬다.
앱 내에서 keydown , keyup 이벤트를 써도 메시지가 뜬다.
하지만
Window.Current.Dispatcher.AcceleratorKeyActivated 이벤트를 받아서 handled = true로 해주면
메시지가 뜨기전에 키보드를 잡을 수 있다.
If you press F7 even if you do not code in the uwp app, the above message appears.
Even if you use keydown and keyup events within the app, a message appears.
but
If you receive the Window.Current.Dispatcher.AcceleratorKeyActivated event and set it to "handled = true",
You can hook the keyboard before the message pop up.
public MainPage()
{
this.InitializeComponent();
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
// this ☆★
Window.Current.Dispatcher.AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated;
// Load App
LoadApplication(new BK.KDS.App());
}
private void Dispatcher_AcceleratorKeyActivated(CoreDispatcher sender, AcceleratorKeyEventArgs args)
{
// Hook F7 Key (Disable Caret Browsing)
if (args.VirtualKey == Windows.System.VirtualKey.F7)
{
args.Handled = true;
}
}
참고
- https://stackoverflow.com/a/45789573
728x90
반응형
'프로그래밍 > Xamarin(자마린)' 카테고리의 다른 글
[Xamarin] KeyDownEvent fires twice on Android (0) | 2022.08.10 |
---|---|
[UWP] 풀스크린 모드로 변경 및 풀스크린 모드(FullScreen & Mode) (0) | 2022.06.07 |
[Xamarin] How to open another app with data (0) | 2021.12.22 |
[Xamarin] How to open another app. (0) | 2021.12.22 |
댓글