02.02.2011, 20:43 | #1 |
Участник
|
Ax and touch screen
Hi, Guys
I have a form similar to(see attachment). User will interact with the form through touch screen without keyboard and mouse. How can I simulate a keypress when the user touches the button on the form? 10x in advance |
|
03.02.2011, 08:23 | #2 |
Участник
|
|
|
03.02.2011, 09:17 | #3 |
MCP
|
Quote:
I think you can use your mouse, if you'll click on buttons in your form in Dynamics you can simulate and debug your action. The method which called when users press buttons on your form is "clicked" independent of the way of pressing |
|
03.02.2011, 13:29 | #4 |
Участник
|
Quote:
X++: void clicked() { super(); ctrl_InputQuantity.setFokus(); element.task(#Key7); // simulate key 7 pressed } Regards, |
|
04.02.2011, 11:12 | #5 |
MCP
|
ist, Hi!
Your idea is good, but i think you can't simulate button click by this method. You can try to place breakpoint in task() method in your form like this: X++: public int task(int _taskId) { int ret; ; ret = super(_taskId); breakpoint; return ret; } |
|
04.02.2011, 12:43 | #6 |
Участник
|
You can use WinAPI:
X++: #WinAPI #KeyPressed void clicked() { super(); ctrl_InputQuantity.setFocus(); ctrl_InputQuantity.setSelection(-1,0); WinAPI::postMessage(ctrl_InputQuantity.hWnd(), #WM_KEYDOWN, #Key7, 0); } |
|
04.02.2011, 17:13 | #7 |
Участник
|
Quote:
Thanks a lot, it works perfect. The bad news is thah in the #KeyPressed I didn't found comma macro. I have noticed that some macroses coincides with ASCII code of the characters. I try with ASCII code 44 that is ASCII code of the comma character, but without success. X++: WinAPI::postMessage(ctrlQty.hWnd(), #WM_KEYDOWN, #Comma, 0); Last edited by ist; 04.02.2011 at 18:50. |
|
05.02.2011, 02:12 | #8 |
Участник
|
I believe WM_KEYDOWN message's wParam parameter is a virtual-key code, not an ASCII-code. VK_OEM_COMMA value is 0xBC.
|
|
05.02.2011, 22:12 | #9 |
Участник
|
Quote:
Originally Posted by gl00mie
I believe WM_KEYDOWN message's wParam parameter is a virtual-key code, not an ASCII-code. VK_OEM_COMMA value is 0xBC.
|
|
«
Previous Thread
|
Next Thread
»
|
|