Trapping the Enter Key on an Edittable (OpenInsight 16-Bit Specific)
At 03 JUL 2003 11:42:05PM Andrew M Matthews wrote:
Hi,
I am wondering how I can trap the key being pressed on an edittable. Using the Keydown windows message (0x0100) does not seem to work for the enter key, only for characters typed (and strangly enough, not the first character).
Does anyone know a better/another way to do this? It would be greatly appreciated.
Thanks,
Andrew Matthews
iTMS Software
At 08 JUL 2003 05:56AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Andrew,
If you're editing data in a cell you may be able to trap the Enter key like so …
In the form's CREATE event qualify the WM_KEYUP window message for the table…
eg.
equ WM_KEYUP$ to 257 call send_Message( @window : ".TABLE_1", "QUALIFY_EVENT", WM_KEYUP$, 1 )Then in the WINMSG event for the edit table the wParam argument should contain the virtual key code for the pressed key, which for Enter key is 13
eg..
equ WM_KEYUP$ to 257 equ VK_ENTER$ to 13 begin case case message=WM_KEYUP$ begin case case wParam=VK_ENTER$ * // Enter key was pressed end case end caseThis is assuming that you're using OI16 of course!
World leaders in all things RevSoft
At 13 JUL 2003 08:20PM Andrew M Matthews wrote:
Sprezz,
The example code you gave me does not seems to work at all.
What I am really looking for is a way to toggle the edit mode of an edittable when the user presses the enter key. My idea was to use a promoted event to capture the enter key being presses, and go from there. Any other ideas?
Cheers,
Andrew Matthews
iTMS Software
At 13 JUL 2003 08:44PM Donald Bakke wrote:
Andrew,
What I am really looking for is a way to toggle the edit mode of an edittable when the user presses the enter key.
Is there a reason you wouldn't want this to occur when the user moves into a cell (i.e. the POSCHANGED event)? This is a common approach.
dbakke@srpcs.com
At 14 JUL 2003 04:41AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Andrew,
The example code you gave me does not seems to work at all.
In that case you have me at a loss as I've just cut and pasted it into a new form and it works fine there too. What bit isn't working? Is the WINMSG event not firing for the edit table at all, or are you not seeing the messages you expect in the WINMSG event?
What I am really looking for is a way to toggle the edit mode of an edittable when the user presses the enter key. My idea was to use a promoted event to capture the enter key being presses, and go from there. Any other ideas?
There is a message you can send to the EditTable that allows you to set the keys used for toggling editmode, but you can't use any of the navigation keys like Enter and Tab for it….
World leaders in all things RevSoft