怎么在数据窗口中用左箭头实现shift+tab在线教程
答:声明函数:
subroutine keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll'
定义用户事件keydown:pbm_dwnkey。
在事件中编程:
integer VK_TAB = 09
integer VK_SHIFT = 16
if key = KeyLeftArrow! then
keybd_event(VK_SHIFT,0,0,0) //按下shift
keybd_event(VK_TAB,0,0,0) //按下tab
keybd_event(VK_TAB,0,2,0) //释放tab
keybd_event(VK_SHIFT,0,2,0) //释放shift
return 1
end if
if key = KeyRightArrow! then
keybd_event(VK_TAB,0,0,0) //按下tab
keybd_event(VK_TAB,0,2,0) //释放tab
return 1
end if
此题由摆渡人工作室站长ferryman回答
kukoc 再提供另一种解决方法(比较原始,但也能实现):
function boolean GetKeyboardState (ref char kbarray[256]) library "user32.dll"
function boolean SetKeyboardState (ref char kbarray[256]) library "user32.dll"
//脚本:用户事件keydown:pbm_dwnkey
char lc_kb[256]
if key = KeyLeftArrow! then
GetKeyboardState (lc_kb)
lc_kb[17] = Char (128)
SetKeyboardState (lc_kb)
Send (Handle (this), 256, 9, 0)
GetKeyboardState (lc_kb)
lc_kb[17] = Char (0)
SetKeyboardState (lc_kb)
end if