mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-17 20:56:29 +02:00
Fix numeric SWKB validation (#5627)
* Fix numeric swkbd validation * GTK
This commit is contained in:
parent
437c78e198
commit
12cbacffca
5 changed files with 26 additions and 9 deletions
|
@ -11,9 +11,9 @@
|
|||
Default = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Only numbers allowed.
|
||||
/// Only 0-9 or '.' allowed.
|
||||
/// </summary>
|
||||
NumbersOnly = 1,
|
||||
Numeric = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Only ASCII characters allowed.
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
||||
{
|
||||
public static partial class NumericCharacterValidation
|
||||
{
|
||||
public static bool IsNumeric(char value)
|
||||
{
|
||||
Regex regex = NumericRegex();
|
||||
|
||||
return regex.IsMatch(value.ToString());
|
||||
}
|
||||
|
||||
[GeneratedRegex("[0-9]|.")]
|
||||
private static partial Regex NumericRegex();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue