问题:点击button1
发送"a"
键到主窗口。我该怎么做?(请举例)
using System;
using Gtk;
namespace pressevent
{
class MainClass
{
public static void Main(string[] args)
{
Application.Init();
MainWindow win = new MainWindow();
win.KeyPressEvent += delegate(object o, KeyPressEventArgs a) {
if(a.Event.Key == Gdk.Key.a)
Console.WriteLine("Key pressed");
else
Console.WriteLine("Key not pressed");
};
Button btn1 = win.getButton1();
btn1.Pressed += (sender, e) =>
{
Console.WriteLine("Button1 pressed");
// Here code that send "a" key to MainWindow
};
win.Show(); Application.Run();
}}}
谢谢。PS:对不起我的英语不好