Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to detect key presses when nothing has focus.

$
0
0

Hello,

I am writing an app for an Android-based scanner. Scanned data is sent to the app as keystrokes (even though the keyboard is not displayed). This works great as long as an entry field has focus. However, it is pretty easy to have nothing focused, so then when the keystrokes come in, they are ignored.

I need a solution for when nothing has focus, so any sort of custom renderer won't help.

Because there are multiple entry fields on the screen, I cannot force focus to an entry field in an Unfocused event, because I can't tell if the control is losing focus because the user tapped on another entry field, or if it's because they've tapped "nowhere", or ... whatever other creative way there is to unfocus to nothing.

I'm using Xamarin Forms, but because this is for a specific Android-based device, I don't need it to work on any other platform.

Any ideas?

Thanks!
-Karen


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>