KEYHANDLED(PaintType[,AlternateChar])


Description :
 


KEYHANDLED(PaintType) Method. If this method is called, in the Keypress Event handler, then GoDB does not execute any further processing.

if PaintType=0 then KEYHANDLED is ignored
if PaintType=1 then Event Bubbling is cancelled and the browser is repainted.
if PaintType=2 then Event Bubbling is cancelled and the browser is NOT repainted.

if PaintType=3 then the key to be sent to GoDB can be replaced using the AlternateChar Parameter - See Example.

NOTE: As this event can occur many times the screen is not updated automatically so call UPDATE method at the end of the event handler if there are any display related functions in the function.

You can also use SetAutoPaint(0) to disable GoDB's Default Painting routines.

Key Codes GETKEY() returns

KEY_F1 1
KEY_F2 2
KEY_F3 3
KEY_F4 4
KEY_F5 5
KEY_F6 6
KEY_F7 7
KEY_F8 8
KEY_F9 9
KEY_F10 10
KEY_F11 11
KEY_F12 12

KEY_RETURN 13
KEY_BACKSPACE 14
KEY_ESC 15

KEY_PGUP 16
KEY_PGDN 17
KEY_HOME 18
KEY_END 19

KEY_LEFT 20
KEY_RIGHT 21
KEY_DELETE 22
KEY_UP 23
KEY_DOWN 24
SCROLL_UP 25
SCROLL_DOWN 26
SCROLL_LEFT 27
SCROLL_RIGHT 28
KEY_RETURNPREV 29

See Also FORM_KEYPRESS , SetAutoPaint


Example :

sub Form_KeyPress
    print getkey()
    KEYHANDLED(1)
endsub


Sub Form_Keypress(Key,FromMouse)
    If Key = 2 Then
        print "F2 Key is pressed"
    End If
    KEYHANDLED(1)
End Sub

' Donot allow Lowercase chars in Text1 Field.
sub Form_Keypress(Key,FromMouse)
if curfld$()="Text1" then 
   if key>=asc("a") and key<=asc("z") then 
     keyhandled(3,asc(ucase$( chr$(key) )) ) 
   endif 
endif
End Sub