Using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. threading. tasks; using System. windows. forms; namespace demo9 {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void Form1_KeyDown (object sender, KeyEventArgs e) {MessageBox. show ("the pressing key is:" + e. keyCode. toSt Ring ();} private void form=mousedown (object sender, MouseEventArgs e) {// responds to different mouse buttons if (e. button = MouseButtons. left) {MessageBox. show ("click the left mouse button! ");} If (e. Button = MouseButtons. Middle) {MessageBox. Show (" click the mouse Button! ");} If (e. Button = MouseButtons. Right) {MessageBox. Show (" Right click! ") ;}} Private void form=mousemove (object sender, MouseEventArgs e) {this. text = "the current cursor position is: (" + e. X + "," + e. Y + ")";}}}