Long story short... I'm running two programs: (1) a Logging pProgram, which may be third party (ie: not mine), and (2) my Control Program which sends stuff in and out of the serial port when one of four buttons are clicked and manages lots of audio stuff. All working fine so far.
Users would like to trigger one of the four buttons on program (2) without clicking on it to transfer the focus away from program (1), clicking the wanted button and then clicking back on program (1). This is entirely reasonable because it saves time when they don't have any to waste and is less error prone under stress.
I modified program (2) to monitor four function keys, with a neat little editor to define four keys not in use by program (1) thus avoiding clashes. It works. Mostly. Some of the functions keys NOT used by program (1) can be monitored by program (2) which is parked out of the way; BUT some function keys seem to remain inactive and look like they are robbed by Windoze.
Even if I compile the following code as an executable and kill jaPBe and ThunderBird (normally running all the time) I still have missing keys. Does anyone know (A) how to determine who owns a function key at any time? (B) How to monitor my choice of function keys, assuming I have dodged keys assigned by launched programs?
Code: Select all
OpenWindow(1,100,100,100,100,"FKeyTest")
StartDrawing(WindowOutput(1))
Repeat
If GetAsyncKeyState_(#VK_F1) : DrawText(10,10, "F1 ") : While GetAsyncKeyState_(#VK_F1) : Wend : EndIf
If GetAsyncKeyState_(#VK_F2) : DrawText(10,10, "F2 ") : While GetAsyncKeyState_(#VK_F2) : Wend : EndIf
If GetAsyncKeyState_(#VK_F3) : DrawText(10,10, "F3 ") : While GetAsyncKeyState_(#VK_F3) : Wend : EndIf
If GetAsyncKeyState_(#VK_F4) : DrawText(10,10, "F4 ") : While GetAsyncKeyState_(#VK_F4) : Wend : EndIf
If GetAsyncKeyState_(#VK_F5) : DrawText(10,10, "F5 ") : While GetAsyncKeyState_(#VK_F5) : Wend : EndIf
If GetAsyncKeyState_(#VK_F6) : DrawText(10,10, "F6 ") : While GetAsyncKeyState_(#VK_F6) : Wend : EndIf
If GetAsyncKeyState_(#VK_F7) : DrawText(10,10, "F7 ") : While GetAsyncKeyState_(#VK_F7) : Wend : EndIf
If GetAsyncKeyState_(#VK_F8) : DrawText(10,10, "F8 ") : While GetAsyncKeyState_(#VK_F8) : Wend : EndIf
If GetAsyncKeyState_(#VK_F9) : DrawText(10,10, "F9 ") : While GetAsyncKeyState_(#VK_F9) : Wend : EndIf
If GetAsyncKeyState_(#VK_F10): DrawText(10,10, "F10 ") : While GetAsyncKeyState_(#VK_F10) : Wend : EndIf
If GetAsyncKeyState_(#VK_F11): DrawText(10,10, "F11 ") : While GetAsyncKeyState_(#VK_F11) : Wend : EndIf
If GetAsyncKeyState_(#VK_F12): DrawText(10,10, "F12 ") : While GetAsyncKeyState_(#VK_F12) : Wend : EndIf
If GetAsyncKeyState_(#VK_ESCAPE) : Break : EndIf
WaitWindowEvent(10)
ForEver
RichardL
Edit: @VB6_to_PBx ... Fixed F8 typo... thanks for pointing it out
