$ESCAPECHARS ON
DECLARE SUB Key1(Key AS WORD, Shift AS INTEGER)
DECLARE SUB Key2(Key AS WORD, Shift AS INTEGER)
DECLARE SUB Key3(Key AS BYTE)
DECLARE SUB ClearFields
CREATE Form AS QFORM
Width = 220
Height = 130
BorderStyle = 4
CREATE Label AS QLABEL
Top = 9
Left = 10
CAPTION = "OnKeyDown\n\n_
OnKeyUp\n\n_
OnKeyPress"
END CREATE
CREATE Edit1 AS QEDIT
Top = 7
Left = 80
ReadOnly = True
Enabled = False
END CREATE
CREATE Edit2 AS QEDIT
Top = 32
Left = 80
ReadOnly =True
Enabled = False
END CREATE
CREATE Edit3 AS QEDIT
Top = 58
Left = 80
ReadOnly = True
Enabled = False
END CREATE
CREATE Dummy AS QBUTTON
Width = 0
TabOrder = 0
END CREATE
CREATE Clear AS QBUTTON
Top = 84
Left = 90
Width = 100
Height = 20
CAPTION = "Clear Fields"
TabOrder = 1
OnClick = ClearFields
END CREATE
KeyPreview = 1
OnKeyDown = Key1
OnKeyUp = Key2
OnKeyPress = Key3
Center
SHOWMODAL
END CREATE
SUB Key1(Key, Shift)
Edit1.Text = "Key " + STR$(Key) + " Shift " + STR$(Shift)
END SUB
SUB Key2(Key, Shift)
Edit2.Text = "Key " + STR$(Key) + " Shift " + STR$(Shift)
END SUB
SUB Key3(Key)
Edit3.Text = "Key " + STR$(Key)
END SUB
SUB ClearFields
Edit1.Text = ""
Edit2.text = ""
Edit3.Text = ""
END SUB
|