Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keylog

Status
Not open for further replies.

hyonos

Technical User
Apr 2, 2003
46
0
0
IT
i want include a keylog in my application but i don't want modify all form...

how can i set _screen.keypree event ?
 
If you are using your own form baseclass, then you'll only need to change it in one place. I suppose in 8.0, you might be able to bind to the this event after setting _Screen.KeyPreview to .T. - have you tried it?

Rick
 
yes, fox8
i have try this solution
suppose 1 form with 1 textbox
in main prg i have write this code:

PUBLIC oHandler
oHandler=NEWOBJECT("myhandler")

do FORM form1
BINDEVENT(Form1,"KeyPress",oHandler,"mykeypress")
BINDEVENT(Form1.Text1,"KeyPress",oHandler,"mykeypress")

DEFINE CLASS myhandler AS Session
PROCEDURE mykeypress
LPARAMETERS nKeyCode, nShiftAltCtrl
WAIT WINDOW nKeyCode nowait
ENDDEFINE

 
I'm assuming that Form1 isn't a modal form. While the second bindevent() should work, unless the form's Keypreview property has been set true, then the form's keypress event will never fire.

Rick


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top