|
| Trapping the F1 key without process() |
 |
Fri, 30 Mar 2007 23:09:54 -040 |
I was surprised that I cannot trigger a key event for a function key
except under process. I have a rather larger program written prior to
process() . I updated the help file recently and found Superbase
could not launch the help file any longer, So I rewrote the help file
menu items to use ShellExec. That all works, but I need to trap the
F1 key and use Shellexec on it also. This does not seem to work
unless you are using process().. Is there a way to trap for this, or
disable the F1 key default action?
The following is my sample program that helped me reach this
conclusion:
SUB main()
ON EVENTCLASS KEY CALL KeyEvent(), EVENTPRIORITY 122
EVENTCLASS KEY ON
WHILE - 1
'WAIT KEY OR MOUSE ' This line will not trap F1
superbase.process() ' This line will trap F1
DEBUG
WEND
END SUB
SUB KeyEvent(t%,k%%,s$)
DEBUG
SELECT CASE k%%
CASE 179' UP
REQUEST "UP"
CASE 180' Down
REQUEST "DOWN"
CASE ELSE
DEBUG
REQUEST S$, STR$ (k%%,"9999")
END CASE
END SUB
|
| Post Reply
|
| Re: Trapping the F1 key without process() |
 |
Sun, 01 Apr 2007 22:13:41 +010 |
Try adding
SET HELP OFF
|
| Post Reply
|
| Re: Trapping the F1 key without process() |
 |
Mon, 02 Apr 2007 14:44:45 -040 |
Works! Thanks. I checked "SET HELP" in the help file, but somehow
overlooked the "See Also" link.
-Dan
On Sun, 01 Apr 2007 22:13:41 +0100, "Phil Alexander"
<philbo@cix.co.ukk> wrote:
>Try adding
>
>SET HELP OFF
>
>before you enter your loop
|
| Post Reply
|
|
|
|
|
|
|
|
|
|