Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jon2g/keyboardvisibilitylistener-maui
https://github.com/jon2g/keyboardvisibilitylistener-maui
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jon2g/keyboardvisibilitylistener-maui
- Owner: Jon2G
- License: mit
- Created: 2024-08-26T22:16:22.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-04T17:40:24.000Z (4 months ago)
- Last Synced: 2024-11-08T06:14:24.172Z (2 months ago)
- Language: C#
- Size: 226 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KeyboardVisibilityListener-MAUI
⚠️ Currently only supports Androidhttps://github.com/user-attachments/assets/ba49f287-1f7c-4fdc-910a-c7f538e22cdf
## Getting started
MauiProgram.cs
```
using KeyboardVisibilityListener;var builder = MauiApp.CreateBuilder();
builder.UseMauiApp()
.UseKeyboardVisibilityListener() //Add this line
//Etc ...```
## Toogle keyboard
```
private void ToggleKeyboardVisibilityClicked(object sender, EventArgs e)
{
KeyBoardUtils.ToggleKeyboardVisibility();
}private void ForceCloseKeyboardClicked(object sender, EventArgs e)
{
KeyBoardUtils.ForceCloseKeyboard(this.Entry1);
}
```## Watch keyboard visibility
```
KeyboardVisibilityState VisibilityState = KeyboardVisibilityState.Instance;//IsKeyboardOpen property also notifies via PropertyChanged
//KeyboardVisibilityState.Instance.IsKeyboardOpenKeyboardVisibilityState.VisibilityChanged += KeyboardVisibilityState_VisibilityChanged;
private void KeyboardVisibilityState_VisibilityChanged(object? sender, KeyboardVisibilityStateChangedEventArgs e)
{
Debug.WriteLine("Keyboard visibility has changed");
}```