KeyBoard.WPF
1.0.1
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.1
NuGet\Install-Package KeyBoard.WPF -Version 1.0.1
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.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KeyBoard.WPF --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KeyBoard.WPF, 1.0.1"
#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.
// Install KeyBoard.WPF as a Cake Addin #addin nuget:?package=KeyBoard.WPF&version=1.0.1 // Install KeyBoard.WPF as a Cake Tool #tool nuget:?package=KeyBoard.WPF&version=1.0.1
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. |
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.
修复BUG