Home > Net > Consult, form single CTRL key trigger how to implement
Consult, form single CTRL key trigger how to implement
Time:10-03
Teach, A winform form, when the cursor in any position, press the left CTRL key alone call a method; But CTRL + c and CTRL + v when not triggered
CodePudding user response:
Press and hold down and trigger buttons? The three listening event is not the same, if it is pressed or hold down the trigger you may want to through the Windows API interceptor window message to do it, if it is a key process after the completion of the (press - & gt; Press and hold - & gt; Loosen the whole process is completed) should be able to intercept keypress events by e.k eycode judgment, For a long time didn't do it form the interception of these events, maybe all I said was wrong also maybe,
CodePudding user response:
Add a key event to form Determines if press the Ctrl key
CodePudding user response:
KeyUp event registration form, that is, after the button press release trigger events Within the event write statement: If (e.K ey==Key. LeftCtrl | | e.K ey==Key. RightCtrl)