KeyBoard.WPF
1.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package KeyBoard.WPF --version 1.0.3
NuGet\Install-Package KeyBoard.WPF -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KeyBoard.WPF" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KeyBoard.WPF" Version="1.0.3" />
<PackageReference Include="KeyBoard.WPF" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add KeyBoard.WPF --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KeyBoard.WPF, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package KeyBoard.WPF@1.0.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=KeyBoard.WPF&version=1.0.3
#tool nuget:?package=KeyBoard.WPF&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
KeyBoard.WPF
一款用于触摸屏输入的屏幕软键盘
开发信息
- NET6 + VS2022
- 使用WPF
支持功能
- 支持NET6及以上版本
- 目前提供2个键盘可选,数字小键盘和全键盘,全键盘是可以打中文的,前提是你的电脑有安装中文包
- 使用的是WPF的行为,目前只能在WPF项目中使用
- 目前键盘只支持单键的按下、松开模拟,跟使用实体键盘一样,但是不支持组合键,且有些键盘上的特殊键(如PageUp等也不支持)
- 使用钩子函数模拟键盘的按下和松开,代码简单,可以自己下载源码编译为其他版本
快速使用
在XAML中先引入包的命名空间
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:keyboard="clr-namespace:KeyBoard.WPF.Behavior;assembly=KeyBoard.WPF"
小键盘(NumericKeyboardBehavior)
<i:Interaction.Behaviors>
<keyboard:NumericKeyboardBehavior/>
</i:Interaction.Behaviors>
全键盘(KeyboardBehavior)
<i:Interaction.Behaviors>
<keyboard:KeyboardBehavior/>
</i:Interaction.Behaviors>
注意事项
- 为了适应(TextBox、PasswordBox等)输入框,在创建行为时,继承的是
Behavior<Control>,理论上是可以在任何继承自Control类的控件中使用,但除了输入框,放在其他的控件上是没有意义的 - 目前的版本,使用了键盘行为的控件必须位于一个继承自
Panel的容器中
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net9.0-windows was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0-windows7.0
- Microsoft.Xaml.Behaviors.Wpf (>= 1.1.39)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.2 | 158 | 4/13/2026 |
| 2.3.1.1 | 129 | 3/18/2026 |
| 2.3.1 | 132 | 3/17/2026 |
| 2.3.0 | 154 | 2/9/2026 |
| 2.2.1 | 133 | 2/9/2026 |
| 2.2.0 | 138 | 2/6/2026 |
| 2.1.0 | 268 | 12/4/2025 |
| 2.0.3 | 263 | 9/27/2025 |
| 2.0.2 | 896 | 3/19/2024 |
| 2.0.1 | 274 | 3/18/2024 |
| 2.0.0 | 286 | 3/18/2024 |
| 1.0.5 | 851 | 3/13/2023 |
| 1.0.4 | 445 | 2/24/2023 |
| 1.0.3 | 631 | 2/21/2023 |
| 1.0.2 | 842 | 7/20/2022 |
| 1.0.1 | 637 | 7/18/2022 |
| 1.0.0 | 864 | 7/18/2022 |
增加小键盘的小数点