//esc Exit form
  protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg , System.Windows.Forms.Keys keyData) // Activate enter
  {
   int WM_KEYDOWN=256;       
   int WM_SYSKEYDOWN = 260;

if(msg.Msg == WM_KEYDOWN | msg.Msg == WM_SYSKEYDOWN)
   {
    switch(keyData)
    {
     case Keys.Escape:
      this.Close();//csc Closing Windows
      break;

case Keys.F12:
      messagebox.show("F12");
      break;

}  
    
   }
   return false;
  }

c# Capture more articles about keyboard buttons

  1. Use the hook function to capture the response of the keyboard windows Applications

    One : introduction : You may have been puzzled by the implementation principle of screen word grabbing in Kingsoft PowerWord , You may want to put your keyboard , The activity of mouse is recorded timely , You even want to know where the Trojan horse is windows How the operating system makes Trojans dll Loaded ….. In fact, these are all used in ...

  2. [VB.NET] call API obtain / Set keyboard key status

    1. call GetAsyncKeyState() Gets the status of the specified key ,GetActiveKey() Retrieve the key status within the specified range 2. call keybd_event() Can synthesize a keystroke event , Usually, it needs to be set between two keystrokes ...

  3. Atitit.android js Keyboard key detection Back key Home Key sum Menu Key events

    Atitit.android js Keyboard key detection Back key Home Key sum Menu Key events 1. onKeyDown @Override public boolean onKeyDown(int keyC ...

  4. JS Capture input in Keyboard keys

    JS Capture input in Keyboard keys The corresponding handling of events is very simple ,google It's easy to find out how to deal with it by searching , Here's a simple way to deal with it : HTML Code : <div> <input typ ...

  5. Android App There are three ways to monitor soft keyboard keys

    Preface :   We are android Sometimes on the mobile phone, you will encounter the time of monitoring the keys on the mobile phone's soft keyboard , for example : We type in the browser url After that, you can click on the bottom right corner of the soft keyboard “GO” Press to load url page : When you click on the search box , Click on the sea ...

  6. keyboard -App There are three ways to monitor soft keyboard keys

    Preface :   We are android Sometimes on the mobile phone, you will encounter the time of monitoring the keys on the mobile phone's soft keyboard , for example : We type in the browser url After that, you can click on the bottom right corner of the soft keyboard “GO” Press to load url page : When you click on the search box , Click on the sea ...

  7. onkeyup The event occurs when the keyboard key is released

    Definition and Usage onkeyup The event occurs when the keyboard key is released . grammar onkeyup="SomeJavaScriptCode" Parameters describe SomeJavaScriptCode It's necessary . ...

  8. Unity3D Get the current keyboard key

    Get the current keyboard key , The code is as follows : using UnityEngine; using System.Collections; public class GetCurrentKey : MonoBehavio ...

  9. C Language to get keyboard keys

    When writing console games , It doesn't work cin,scanf still getchar, Can't input keys in real time , You have to press enter to read in , Pressing enter will result in an abnormal input , So use the function to get the keyboard keys . Add header file #includ ...

Random recommendation

  1. java web( 7、 ... and )Cookie Simple use

    One . summary test //1. Create a Cookie object     //Cookie cookie1=new Cookie("name","xrk");    //2. call ...

  2. 【Linux_Fedora_ Application series 】_2_ How to install video player and video file decoding

    In a previous blog post , We installed the music player and the decoder .[Linux_Fedora_ Application series ]_1_ How to install the music player and mp3 decode Here we're going to install the video player . We still go through yum Way to install . ...

  3. 【USACO 2.1】Ordered Fractions

    /* TASK: frac1 LANG: C++ URL: http://train.usaco.org/usacoprob2?S=frac1&a=dbgwn5v2WLr SOLVE: Direct ...

  4. CLOUDSTACK To take over VCENTER, Frequent accidents , But in the end

    Can't , The first time I eat crabs , Always live . not so bad , I have a heart that is not kitsch ~~ But secondary storage , and Storage performance , It has to be taken into account .

  5. webapi Frame building - Dependency injection autofac

    Preface c# The dependency injection framework of is unity.autofac, Both bloggers have used , Feeling unity It's simple and autofac It's more functional ( Naturally, it's a little more complicated ), This article will be based on what has been created in previous articles webapi project , introduce au ...

  6. spring boot2.0.4 Integrate druid, use jmeter Concurrent testing tool calls interface ,druid Look at the results of the monitoring

    One . Project introduction ( The programming language used in this project is jdk8, Project source code :https://github.com/zhzhair/spring-boot-druid.git) 1. introduce pom rely on : <dependen ...

  7. C++ Injected Notepad upgrade , Get love for notepad

    #include <iostream>; using namespace std; #include <windows.h>; #include <tlhelp32.h& ...

  8. Trigger Full GC Implementation And other supplementary information

    Except for calling directly System.gc Outside , Trigger Full GC There are four types of implementation .1. The space of the old generation is insufficient. The space of the old generation can only be transferred and created as large objects in the new generation . Large array will be insufficient , When executed Full GC There is still not enough space behind ...

  9. Oracle 11g PL/SQL&#160;Developer Login time ORA-12638:&#160; The solution to the failure of ID Retrieval ( Installed 6 All over , The work of spitting blood )

    1. When this error is reported, a dialog box will pop up , Click terminate first 2. And report that this is the wrong window , Then click OK , But don't close this installation window, and don't do other unnecessary operations , Minimize the window 3. find product Folder , Generally in app In the document ...

  10. js Graphic workflow designer

        I've been relatively idle recently , I'm going to develop a computer with js Written Graphic workflow designer , Attach a sketch , To see the effect, please download the attachment , This version is still under development , It will be updated in the future , Until you are satisfied . Although the Liezi above is deformed , I still posted it , One for you ...