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
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
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
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.
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