-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
136 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Shanedler.Workarounds/PureWeen.Maui.FixesAndWorkarounds.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
ShanedlerSamples/Library/KeyboardBehavior/CustomKeyboardController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#if IOS || MACCATALYST | ||
using System; | ||
using Foundation; | ||
using Microsoft.Maui.Platform; | ||
using UIKit; | ||
|
||
namespace Maui.FixesAndWorkarounds | ||
{ | ||
public class CustomKeyboardController : PageViewController | ||
{ | ||
static List<KeyboardBehavior> keyboardBehaviors = new List<KeyboardBehavior>(); | ||
public CustomKeyboardController(IView page, IMauiContext mauiContext) : base(page, mauiContext) | ||
{ | ||
} | ||
|
||
|
||
public override void PressesBegan(NSSet<UIPress> presses, UIPressesEvent evt) | ||
{ | ||
base.PressesBegan(presses, evt); | ||
|
||
foreach (var item in keyboardBehaviors) | ||
item.PressesBegan(presses, evt); | ||
|
||
} | ||
|
||
public override void PressesEnded(NSSet<UIPress> presses, UIPressesEvent evt) | ||
{ | ||
base.PressesEnded(presses, evt); | ||
|
||
foreach (var item in keyboardBehaviors) | ||
item.PressesEnded(presses, evt); | ||
} | ||
|
||
public static void Register(KeyboardBehavior keyboardBehavior) | ||
{ | ||
keyboardBehaviors.Add(keyboardBehavior); | ||
} | ||
|
||
public static void UnRegister(KeyboardBehavior keyboardBehavior) | ||
{ | ||
keyboardBehaviors.Remove(keyboardBehavior); | ||
} | ||
} | ||
|
||
|
||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
using Foundation; | ||
using Maui.FixesAndWorkarounds; | ||
using UIKit; | ||
|
||
namespace ShanedlerSamples; | ||
|
||
[Register("AppDelegate")] | ||
public class AppDelegate : MauiUIApplicationDelegate | ||
{ | ||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
static List<KeyboardBehavior> keyboardBehaviors = new List<KeyboardBehavior>(); | ||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
|
||
public override void PressesBegan(NSSet<UIPress> presses, UIPressesEvent evt) | ||
{ | ||
base.PressesBegan(presses, evt); | ||
|
||
foreach (var item in keyboardBehaviors) | ||
item.PressesBegan(presses, evt); | ||
|
||
public override void PressesBegan(NSSet<UIPress> presses, UIPressesEvent evt) | ||
{ | ||
base.PressesBegan(presses, evt); | ||
} | ||
} | ||
|
||
public override void PressesEnded(NSSet<UIPress> presses, UIPressesEvent evt) | ||
{ | ||
base.PressesEnded(presses, evt); | ||
} | ||
public override void PressesEnded(NSSet<UIPress> presses, UIPressesEvent evt) | ||
{ | ||
base.PressesEnded(presses, evt); | ||
|
||
public override UIKeyCommand[] KeyCommands => base.KeyCommands; | ||
foreach (var item in keyboardBehaviors) | ||
item.PressesEnded(presses, evt); | ||
} | ||
|
||
public static void Register(KeyboardBehavior keyboardBehavior) | ||
{ | ||
keyboardBehaviors.Add(keyboardBehavior); | ||
} | ||
|
||
public static void UnRegister(KeyboardBehavior keyboardBehavior) | ||
{ | ||
keyboardBehaviors.Remove(keyboardBehavior); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
using Foundation; | ||
using Maui.FixesAndWorkarounds; | ||
using UIKit; | ||
|
||
namespace ShanedlerSamples; | ||
|
||
[Register("AppDelegate")] | ||
public class AppDelegate : MauiUIApplicationDelegate | ||
{ | ||
|
||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters