Capture Key press in .net maui App

Hello,

When user press any key, I would like to do a sfPopup for user interaction in the app.


Any suggestion is appreciated 

thanks

Praveen



3 Replies

AF Anees Fathima Shajahan Syncfusion Team October 4, 2024 02:05 PM UTC

Hi Praveen,


As of now, the SfPopup does not support keyboard interaction. Could you please clarify your scenario in more detail? Specifically:

  • Do you want the popup to open when any specific key is pressed?
  • Are you looking to capture key presses for buttons (like Accept or Decline) within the popup?
  • Should the popup close when a key is pressed?

Providing these details will help us analyze your needs more accurately and quickly offer a suitable workaround.


Regards,

Anees Fathima.



PD Praveen D October 5, 2024 04:07 AM UTC

Would like to have popup to open when any key is pressed.


Also after popup is open. It would be great if it can be close on Enter Key press or any Key press


thanks




AF Anees Fathima Shajahan Syncfusion Team October 7, 2024 02:49 PM UTC

Hi Praveen,


We have created a sample using a custom grid with a keyboard listener attached. When the 'O' key is pressed, the popup opens. The same custom grid is used inside the popup's content template, and when the 'Enter' key is pressed, the popup closes. Please refer to the sample below for more details, and feel free to reach out if you have any concerns or further questions.


Regards,

Anees Fathima.


Attachment: SimplePopup_98cbbde7.zip

Loader.
Up arrow icon