KeyBoard.WPF 2.1.0

dotnet add package KeyBoard.WPF --version 2.1.0
                    
NuGet\Install-Package KeyBoard.WPF -Version 2.1.0
                    
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="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KeyBoard.WPF" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="KeyBoard.WPF" />
                    
Project file
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 2.1.0
                    
#r "nuget: KeyBoard.WPF, 2.1.0"
                    
#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@2.1.0
                    
#: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=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=KeyBoard.WPF&version=2.1.0
                    
Install as a Cake Tool

KeyBoard.WPF

一款用于触摸屏输入的屏幕软键盘

开发信息

  • NET + VS2026
  • 使用WPF

支持功能

  • 支持NET6,7,8,9,10及以上版本
  • 支持Net Framework4.62
  • 目前提供2个键盘可选,数字小键盘和全键盘,全键盘是可以打中文的,前提是你的电脑有安装中文包
  • 使用的是WPF的行为,目前只能在WPF项目中使用
  • 目前键盘支持单键的按下、松开模拟,跟使用实体键盘一样,支持组合键
  • 在全键盘中部分键位只显示,不支持,例如:FN,WIN,INS,DEL等
  • 使用钩子函数模拟键盘的按下和松开,代码简单,可以自己下载源码编译为其他版本

快速使用

在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>

全键盘

可选配置

设置键盘的底色,设置字体大小

<i:Interaction.Behaviors>
    <keyboard:KeyboardBehavior UCBackground="Red" UCFontSize="30"/>
</i:Interaction.Behaviors>

注意事项

  • 为了适应(TextBox、PasswordBox等)输入框,在创建行为时,继承的是Behavior<Control>,理论上是可以在任何继承自Control类的控件中使用,但除了输入框,放在其他的控件上是没有意义的
  • 目前的版本,使用了键盘行为的控件必须位于一个继承自Panel的容器中

版本说明

2.1.0

  • 全键盘界面美化
  • 全键盘增加组合键的支持
Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net7.0-windows7.0 is compatible.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.0 200 12/4/2025
2.0.3 185 9/27/2025
2.0.2 807 3/19/2024
2.0.1 217 3/18/2024
2.0.0 221 3/18/2024
1.0.5 797 3/13/2023
1.0.4 412 2/24/2023
1.0.3 583 2/21/2023
1.0.2 796 7/20/2022
1.0.1 589 7/18/2022
1.0.0 813 7/18/2022

优化全键盘,增加组合键的支持,界面美化