KeyBoard.WPF 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package KeyBoard.WPF --version 1.0.2                
NuGet\Install-Package KeyBoard.WPF -Version 1.0.2                
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.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KeyBoard.WPF --version 1.0.2                
#r "nuget: KeyBoard.WPF, 1.0.2"                
#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.2

// Install KeyBoard.WPF as a Cake Tool
#tool nuget:?package=KeyBoard.WPF&version=1.0.2                

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

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.0.2 336 3/19/2024
2.0.1 102 3/18/2024
2.0.0 119 3/18/2024
1.0.5 601 3/13/2023
1.0.4 288 2/24/2023
1.0.3 456 2/21/2023
1.0.2 643 7/20/2022
1.0.1 453 7/18/2022
1.0.0 503 7/18/2022

修复BUG