From: Lyle J. <ly...@kn...> - 2004-01-31 15:11:21
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jan 31, 2004, at 8:59 AM, Jeremy Cowgar wrote: > I want to trap the enter key on a given FXTextField. I associated an > ID, > inserted a FXMAPFUNC(SEL_KEYRELEASE,...). My function obviously runs > whenever a key is released, but how do I tell what key was just > entered? The data passed along with a SEL_KEYRELEASE message is a pointer to an FXEvent struct, and the "code" field of that struct holds the key code. So something like: long onKeyRelease(FXObject *sender, FXSelector sel, void *ptr) { FXEvent *event = reinterpret_cast<FXEvent *>(ptr); if (event->code == KEY_Return) { ... } return 1; } Hope this helps, Lyle -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFAG8WSFXV/hD6oMd0RAsUEAJ9mJE/wQbymO7HG26RmhKGxJmZCCQCfVbR0 FJsxiewhGnt85OZuEhv/gSI= =5mdU -----END PGP SIGNATURE----- |