Capture key

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
jouhmg
Posts: 26
Joined: Thu Jul 31, 2008 3:22 am

Capture key

Post by jouhmg »

Hi:

How can capture the key used to exit a textbox (PASSWORD)?

I tested with:

ON LOSTFOCUS {|| If( LastKey() = K_ESC, ControlEscape(), Validar Acceso(cPass)) }

and does not work.

TIA
jouhmg
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Capture key

Post by Rathinagiri »

IMHO, Windows API provides total control to the "textbox". We can capture particular key pressing event only for a window container as a whole.

If we want to process Esc key sequence separately, we can use the following:

ON KEY <Key>

[ OF <ParentWindow> ]

ACTION <ActionProcedureName> | <bBlock>
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
jouhmg
Posts: 26
Joined: Thu Jul 31, 2008 3:22 am

Re: Capture key

Post by jouhmg »

English by Google
*************
Hi:

I solved by replacing:

ON KEY ESCAPE OF...
...
...
ON LOSTFOCUS {|| If( LastKey() = K_ESC, ControlEscape(), ValidarAcceso(cPass)) }

by:

ON KEY ESCAPE OF...
...
...
ON ENTER {|| ValidarAcceso(cPass) }

Thank you very much for responding.
jouhmg
Post Reply