2014-03-27 3 views
1

위로 화살표를 클릭하면 Shift + Tab 명령을 실행해야합니다. 그러나이를 수행하는 방법을 모릅니다.PowerBuilder에서 Shift + Key를 트리거하는 방법

도움이 필요합니다 ^^

가능합니까?

+0

Shift-Tab 키를 사용하여 소프트웨어에서 기대할 수있는 기능은 무엇입니까? – Seki

답변

1
//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 
+0

고마워요 ^^ – Cechinel

관련 문제