CodePudding user response:
About how to use the focus of the key column and the enter key to transfer?Q: can you tell me about how to realize the use of keys and the enter key focus for column?
A: it should use Windows API function of keybd_event ()
1) define the API:
Subroutine keybd_event (uint bVk, uint bScan, long dwFlags, long dwExtraInfo) library "user32. DLL
"
(2) a custom user events (ue_keydown ID: pbm_dwnkey) :
The integer VK_TAB=09
The integer VK_SHIFT=16
If the key=KeyLeftArrow! Then
Keybd_event (VK_SHIFT, 0, 0)//pressing shift
Keybd_event (VK_TAB, 0, 0)//press TAB
Keybd_event (VK_TAB, 0, 0)//release TAB
Keybd_event (VK_SHIFT, 0, 0)//release shift
Return 1
End the if
If the key=KeyRightArrow! The or key=KeyEnter! Then
Keybd_event (VK_TAB, 0, 0)//press TAB
Keybd_event (VK_TAB, 0, 0)//release TAB
Return 1
End the if
If just want to use the ENTER key to realize the function of the TAB key can use the following code:
If the key=keyenter! Then
Send (Handle (this), 256, 9, Long (0, 0))//Send the TAB key to
Return 1//cancel the ENTER key action
End the if
CodePudding user response:
Thank you, I try, however, be obliged!