1[DllImport ("user32.dll")]2 Public Static extern voidKeybd_event (byteBVK,byteBscan,UINTDwFlags,UINTdwextrainfo);3 4 5Nativemethods.keybd_event (Bkey,0x45, Nativemethods.keyeventf_extendedkey |0,0);6Nativemethods.keybd_event (Bkey,0x45, Nativemethods.keyeventf_extendedkey | Nativemethods.keyeventf_keyup,0);
Bkey using The ASCII code of the virtual keyboard
Note that the letters are uppercase and lowercase (if you look at the ASCII code of the virtual keyboard, you will find that only uppercase and lowercase ) capitalization issues are given to the CAPS lock and SHIFT keys to handle
The topic of virtual keyboard, focus on the output content of the control focus on the acquisition, so think about the bias, will be more and more complex. Do a good job of triggering the keyboard to press the action, focus is not the tube, the focus depends on the user action
Remember to put the control of the analog button focusable= "False" so that the focus of the simulated keyboard click does not move to the focus on it. You don't have to worry about it.
C # virtual keyboard