//API function declaration to simulate keystrokes GLOBAL EXTERNAL FUNCTION
subroutine keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll'
public function integer of_presskey (integer ai_key);//Calls an API function to simulate a key press
keybd_event(ai_key,0,0,0)
return 1
end function
public function integer of_releasekey (integer ai_key);//Calls an API function to simulate a key release
keybd_event(ai_key,0,2,0)
return 1
end function
//Put the following in the KEY event if available. Otherwise create a custom event using //the Event ID pbm_keydown for regular objects or the Event ID pbm_dwnkey for DataWindows.
CONSTANT INT VK_SHIFT = 16 //Keycode for the SHIFT key
CONSTANT INT VK_TAB = 09 //Keycode for the TAB key
//Simulates a TAB keystroke when the DOWN ARROW OR ENTER is pushed as long
//as it isn't on the last column or the last row. Kills the DOWN ARROW
//keypress
if ((key = KeyDownArrow! OR key = KeyEnter!)) then
ibl_noenter = false
of_presskey(VK_TAB)
of_releasekey(VK_TAB)
Yield()
return 1
//Simulates a SHIFT + TAB keystroke when the UP ARROW is pushed.
//Kills the UP ARROW keypress
elseif (key = KeyUpArrow!) then
ibl_noenter = true
//Simulating SHIFT + TAB Keystroke
of_presskey(VK_SHIFT)
of_presskey(VK_TAB)
of_releasekey(VK_SHIFT)
of_releasekey(VK_TAB)
Yield()
//Allows a TAB keypress to go through
elseif (key = KeyTab!) then
return 0
end if
How to trigger Shift + Key in PowerBuilder
-
22-06-2023 - |
Pregunta
I need to execute the Shift + Tab by command when I click on Arrow Up, but I have no idea how to do this.
I need your help ^^
Is it possible?
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow