Generate Keystrokes In PowerBuilder
Key | Ascii | Key | Ascii |
L-Button | 1 | W | 87 |
R-Button | 2 | X | 88 |
Cancel | 3 | Y | 89 |
M-Button | 4 | Z | 90 |
Back | 8 | NP – 0 | 96 |
Tab | 9 | NP – 1 | 97 |
Clear | 12 | NP – 2 | 98 |
Return | 13 | NP – 3 | 99 |
Shift | 16 | NP – 4 | 100 |
Control | 17 | NP – 5 | 101 |
Menu | 18 | NP – 6 | 102 |
Pause | 19 | NP – 7 | 103 |
Cap | 20 | NP – 8 | 104 |
Escape | 27 | NP – 9 | 105 |
Space | 32 | * | 106 |
Prior | 33 | + | 107 |
Next | 34 | – | 109 |
End | 35 | . | 110 |
Home | 36 | / | 111 |
Left | 37 | F1 | 112 |
Up | 38 | F2 | 113 |
Right | 39 | F3 | 114 |
Down | 40 | F4 | 115 |
Select | 41 | F5 | 116 |
Print Scrn | 44 | F6 | 117 |
Insert | 45 | F7 | 118 |
Delete | 46 | F8 | 119 |
Help | 47 | F9 | 120 |
0 | 48 | F10 | 121 |
1 | 49 | F11 | 122 |
2 | 50 | F12 | 123 |
3 | 51 | F13 | 124 |
4 | 52 | F14 | 125 |
5 | 53 | F15 | 126 |
6 | 54 | F16 | 127 |
7 | 55 | F17 | 128 |
8 | 56 | F18 | 129 |
9 | 57 | F19 | 130 |
A | 65 | F20 | 131 |
B | 66 | F21 | 132 |
C | 67 | F22 | 133 |
D | 68 | F23 | 134 |
E | 69 | F24 | 135 |
F | 70 | Numlock | 144 |
G | 71 | Scroll | 145 |
H | 72 | Rshift | 161 |
I | 73 | L-Ctrl | 162 |
J | 74 | R-Ctrl | 163 |
K | 75 | L-Menu | 164 |
L | 76 | R-Menu | 165 |
M | 77 | = | 187 |
N | 78 | , | 188 |
O | 79 | [ | 189 |
P | 80 | . | 190 |
Q | 81 | / | 191 |
R | 82 | ‘ | 192 |
S | 83 | [ | 219 |
T | 84 | / | 220 |
U | 85 | ] | 221 |
V | 86 | ‘ | 222 |
Declaration Of External Function:
1 | Subroutine keybd_event( Int bVk, Int bScan, Int dwFlags, Int dwExtraInfo) Library "user32.dll" |
Create Print Screen:
1 2 | keybd_event( 44, 1, 0, 0) // Copy the entire screen to the clipboard. keybd_event( 44, 0, 0, 0) // Copy only the currently active window to the clipboard. Same as ALT+PRTSCR. |
The following code dynamically triggers The Paste operation, equivalent To pressing CTRL + V:
1 2 | mle_1.SetFocus() Send(Handle(rte_1),770, 0, 0) |
PowerBuilder enter a Message In Notepad:
1 2 3 4 5 6 7 8 9 10 | Integer li_loop, li_len, li_asc String ls_msg = "Programming Method Information" + Char(110) + Char(13) Run("Notepad.exe") For li_loop = 1 To li_len li_asc = Asc(Mid(ls_msg,li_loop,1)) keybd_event(li_asc, 1, 0, 0) Yield() // Let the text be entered in the notepad before the buffer overflows. Next |
User Event linked To pbm_dwnkey
1 2 3 4 5 6 7 8 9 10 | Choose Case Key Case KeyF4! // Press F4 to move the column in the reverse direction. keybd_event(16,0,0,0) // SHIFT was pressed. keybd_event(9,0,0,0) // TAB was pressed. keybd_event(16,0,2,0) // SHIFT appeared. (Cannot be omitted) keybd_event(9,0,2,0) // TAB is raised. (Can be omitted) Case KeyF5! // Press F5 to move the column forward. keybd_event(9,0,0,0) // TAB was pressed. keybd_event(9,0,2,0) // TAB appeared. (Omitted) End Choose |
Good Luck!