You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
C#
51 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace JwKdsV.Component
|
|
{
|
|
public partial class LoginKeyboardX : UserControl
|
|
{
|
|
public LoginKeyboardX()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public delegate void EventHandle(object sender, LoginKeyboardEventArgs e);
|
|
|
|
public event EventHandle LoginKeyboardButtonClick;
|
|
|
|
protected virtual void OnButtonClick(LoginKeyboardEventArgs e)
|
|
{
|
|
LoginKeyboardButtonClick?.Invoke(this, e);
|
|
}
|
|
|
|
private void OnKeyClick(object sender, EventArgs e)
|
|
{
|
|
var t = sender as TouchButtonX;
|
|
OnButtonClick(new LoginKeyboardEventArgs(t.KeyCode));
|
|
}
|
|
}
|
|
|
|
public class LoginKeyboardEventArgs : EventArgs
|
|
{
|
|
private readonly string _key;
|
|
|
|
public LoginKeyboardEventArgs(string key)
|
|
{
|
|
this._key = key;
|
|
}
|
|
|
|
public string Key
|
|
{
|
|
get { return _key; }
|
|
}
|
|
|
|
}
|
|
}
|